lib/pry-theme.rb in pry-theme-0.0.8 vs lib/pry-theme.rb in pry-theme-0.0.9
- old
+ new
@@ -30,15 +30,16 @@
THEME_DIR = File.join(CONFIG_DIR, "themes")
# The name of the default theme of Pry Theme.
DEFAULT_THEME_NAME = "pry-classic"
+ # The URI for GitHub API link to Pry Theme Collection contents.
+ COLLECTION = "https://api.github.com/repos/kyrylo/pry-theme-collection/contents"
+
def self.set_theme(theme_name)
- theme = PryTheme.convert(theme_name)
- if theme ||= PryTheme.convert(theme_name = DEFAULT_THEME_NAME)
- ::CodeRay::Encoders::Terminal::TOKEN_COLORS.merge!(theme)
- @current_theme = theme_name
- end
+ return unless theme = PryTheme.convert(theme_name)
+ ::CodeRay::Encoders::Terminal::TOKEN_COLORS.merge!(theme)
+ @current_theme = theme_name
end
def self.current_theme
@current_theme
end