pry-theme 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6ec3ba87078dcd871ff8f2e8ca16043f2f9303b
4
- data.tar.gz: 3f3a8984f4e7505ef9a8b259b67a3558b1a25ad4
3
+ metadata.gz: 657593d26a0afa7197bdeda4e33dac70dd3d13b5
4
+ data.tar.gz: eb3bf3c8dbc7c5a7f16b97027f7ea856d1efb33a
5
5
  SHA512:
6
- metadata.gz: 12651266f54f2d5e9f25410152d90ad2df7ae65b1eedd7be71dfbcd323607fe989e019b86c7c90e4595a1f96c43450b3b7754ef3dcfa28e4c7695a3db921c964
7
- data.tar.gz: c82fb3357830836e1836e5331ec2c127d85a96fbd7c016888ba4239ec4c3f1ecce8fead4e39257d3d969b72cdc25b1bbcb106d500d884aba34722af0820af23e
6
+ metadata.gz: 5f3b617dab0c190ab3bbad3c8d00914f528b9235fecd8ad8895f9085d7243f71d79dfdcaef26ac5690d531ca2da841d45cc06e637456208f4d6c58edb074819b
7
+ data.tar.gz: 08fa73ba0512df853a2892c5f264cb830c77a3575f0a7d6719767ee169efe58511a55e9d530ef0b93f7aac9af799cbf94b48b0f4085fed83235e7dec3b3caa96
@@ -1,19 +1,16 @@
1
1
  rvm:
2
- - 1.8.7
3
2
  - 1.9.2
4
3
  - 1.9.3
4
+ - 2.0.0
5
+ - 2.1
5
6
  - ruby-head
6
- - ree
7
- - rbx-18mode
8
- - rbx-19mode
9
- - jruby-18mode
10
- - jruby-19mode
7
+ - rbx-2
8
+ - jruby
11
9
  - jruby-head
12
10
 
11
+ script:
12
+ - rake spec
13
+
13
14
  branches:
14
15
  only:
15
16
  - master
16
-
17
- before_install:
18
- - gem install sinatra
19
- - gem install random-word
@@ -1,6 +1,12 @@
1
1
  Pry Theme changelog
2
2
  ===================
3
3
 
4
+ ### v1.0.3 (May 12, 2014)
5
+
6
+ * Fixed error when Pry.config.theme is set to a theme that doesn't exist
7
+ [→](https://github.com/kyrylo/pry-theme/issues/39)
8
+ * Corrected README.md errors and confusing parts
9
+
4
10
  ### v1.0.2 (January 28, 2014)
5
11
 
6
12
  * Set stricter dependencies (namely, Pry Theme started demanding CodeRay v1.1.0
data/README.md CHANGED
@@ -35,11 +35,18 @@ following line to your `.pryrc`:
35
35
 
36
36
  Pry.config.theme = "theme-name"
37
37
 
38
- The default theme is `pry-classic` (basically, you shouldn't notice it, because
39
- it resembles the default outlook of Pry, as though you didn't install anything).
38
+ The default theme is the one from the `pry-classic` family. It is dependent on
39
+ your terminal capabilities. For example, if you're using Windows, your default
40
+ theme will be `pry-classic-16`, since the Windows terminal can't support more
41
+ than 16 colours. If you're using xterm or urxvt, then your default theme will be
42
+ `pry-classic-256` (basically, you shouldn't notice it, because it resembles the
43
+ default outlook of Pry, as though Pry Theme isn't present). This outlines the
44
+ rule: the more colours your terminal supports, the more vivid version of
45
+ `pry-classic` is used.
46
+
40
47
  Let's change it to something more neoteric:
41
48
 
42
- Pry.config.theme = "pry-modern"
49
+ Pry.config.theme = "pry-modern-256"
43
50
 
44
51
  That's all! Launch your Pry and you will see the changes.
45
52
 
@@ -49,9 +56,9 @@ Pry Theme has a command-line interface available via Pry. Just launch Pry and
49
56
  start working with it. For example, you can _temporary_ change themes on the
50
57
  fly (only for the current session):
51
58
 
52
- [1] pry(main)> pry-theme try pry-classic
59
+ [1] pry(main)> pry-theme try pry-classic-8
53
60
 
54
- This subcommand would switch your current theme to `pry-classic` theme.
61
+ This subcommand would switch your current theme to `pry-classic-8` theme.
55
62
 
56
63
  You can find [more information about CLI in Pry Theme Wiki][cli].
57
64
 
@@ -67,7 +74,7 @@ If you already have your theme stored somewhere on disk, just put it in the
67
74
 
68
75
  If you don't want to bother with routine operations, you can install a theme
69
76
  from the Collection with help of `pry-theme install <name>` subcommand. For
70
- example, you can want to install xoria256 theme. Just execute
77
+ example, you can want to install the xoria256 theme. Just execute
71
78
  `pry-theme install xoria256` and you're done.
72
79
 
73
80
  Oh, and don't forget to adjust your `.pryrc`!
data/Rakefile CHANGED
@@ -8,8 +8,8 @@ def test_files
8
8
  end
9
9
 
10
10
  desc "Run tests"
11
- task :test do
11
+ task :spec do
12
12
  exec "bacon -Ispec #{ quiet } #{ test_files }"
13
13
  end
14
14
 
15
- task :default => :test
15
+ task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -4,9 +4,10 @@ module PryTheme
4
4
  recreate_user_themes_from_default_ones
5
5
  load_themes
6
6
 
7
- if Pry.config.theme
7
+ if File.exist?(theme_file)
8
8
  ThemeList.activate_theme(Pry.config.theme)
9
9
  else
10
+ display_warning(_pry_) if Pry.config.theme
10
11
  ThemeList.activate_theme_intelligently
11
12
  end
12
13
  end
@@ -15,12 +16,12 @@ module PryTheme
15
16
 
16
17
  # Copy a default theme to theme directory, but only if it isn't there yet.
17
18
  def recreate_user_themes_from_default_ones
18
- FileUtils.mkdir_p(USER_THEMES_DIR) unless File.exists?(USER_THEMES_DIR)
19
+ FileUtils.mkdir_p(USER_THEMES_DIR) unless File.exist?(USER_THEMES_DIR)
19
20
  default_themes = Dir.entries(DEF_THEMES_DIR) - %w{. ..}
20
21
 
21
22
  default_themes.each do |theme|
22
23
  user_theme_path = File.join(USER_THEMES_DIR, theme)
23
- unless File.exists?(user_theme_path)
24
+ unless File.exist?(user_theme_path)
24
25
  def_theme_path = File.join(DEF_THEMES_DIR, theme)
25
26
  FileUtils.cp(def_theme_path, USER_THEMES_DIR)
26
27
  end
@@ -34,5 +35,15 @@ module PryTheme
34
35
  end
35
36
  end
36
37
 
38
+ def theme_file
39
+ File.join(USER_THEMES_DIR, Pry.config.theme.to_s + PT_EXT)
40
+ end
41
+
42
+ def display_warning(pry)
43
+ pry.output.puts 'Pry Theme Warning: Pry.config.theme is set to ' +
44
+ "\"#{ Pry.config.theme }\". There's no such a theme in your system. " +
45
+ "All installed themes live inside #{ USER_THEMES_DIR }. Falling back " +
46
+ 'to the default theme for now.'
47
+ end
37
48
  end
38
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyrylo Silin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.2.0
176
+ rubygems_version: 2.2.2
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: An easy way to customize Pry colors via theme files