icepick 0.2.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad1c12a8b27ae80252b65e9d40d4837475c46188
4
- data.tar.gz: 9d881759f66b7e97e0242c34cf5c4e03ec56ba55
3
+ metadata.gz: 218a1a1b4b38c772917f9af5facb5a69a33815cf
4
+ data.tar.gz: 78262362bfe746bbb20dbfc14c060dd90ae3e4a8
5
5
  SHA512:
6
- metadata.gz: 4720363a7892653fb14db609cf9d710b3333e28783d2d1ee86f374ab4d62caf486554c26bfc9dc51712cac3bf06fa9ad6d7f8667d92ae917adb77336947f3357
7
- data.tar.gz: 18a2989fbd19a76611fa830c20d5d61bd4158febe8aa4c466e055c4b275447945e646423350f88b67942a16e7a5321c6d5e919cf3f6c6ae223520e448068d37b
6
+ metadata.gz: 6b8b4c5f36552f5eeec09609bcb153677694758d2216e1ddcc3a0be6174508d9348eeed1879c35cac1e8507ca25c56b7bd5a7c18ae6d1bed4ffb443feb72a157
7
+ data.tar.gz: e72c6e6dc7a5b352a5847a6917a46b678d8bc2ede5127852df9daacd650f13fe607a46772642ab7a74bda22adc69e0fc2d2515f2ba9a395400f37f74562e2e89
@@ -1,3 +1,13 @@
1
+ ## 1.1.0 (2014-04-26)
2
+
3
+ * Removed out-of-box support for Rails. This includes removing pry-rails and railties dependencies.
4
+ * Removed `formatted` configuration option; format all the things!
5
+ * Removed `name` from prompt and configuration
6
+
7
+ ## 1.0.0 (2014-04-25)
8
+
9
+ * Replaced pry-debugger with pry-byebug. This change breaks support for Ruby versions older than 2.0.0
10
+
1
11
  ## 0.2.0 (2014-01-01)
2
12
 
3
13
  * Prompt layout now more configurable. Added a new dependency on [colorize][colorize].
@@ -9,7 +19,6 @@
9
19
  [pry]: http://pry.github.com
10
20
  [pry-doc]: https://github.com/pry/pry-doc
11
21
  [pry-stack_explorer]: https://github.com/pry/pry-stack_explorer
12
- [pry-debugger]: https://github.com/nixme/pry-debugger
13
22
  [pry-byebug]: https://github.com/deivid-rodriguez/pry-byebug
14
23
  [pry-rails]: https://github.com/rweng/pry-rails
15
24
  [awesome_print]: https://github.com/michaeldv/awesome_print
@@ -1,81 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- icepick (0.2.0)
4
+ icepick (1.1.0)
5
5
  awesome_print (~> 1.2)
6
6
  colorize (~> 0.6.0)
7
7
  pry (~> 0.9.12)
8
- pry-debugger (~> 0.2.2)
8
+ pry-byebug (~> 1.3.2)
9
9
  pry-doc (~> 0.4.6)
10
- pry-rails (~> 0.3.2)
11
10
  pry-stack_explorer (~> 0.4.9)
12
- railties (>= 3.0, < 5.0)
13
11
 
14
12
  GEM
15
13
  remote: https://rubygems.org/
16
14
  specs:
17
- actionpack (4.0.2)
18
- activesupport (= 4.0.2)
19
- builder (~> 3.1.0)
20
- erubis (~> 2.7.0)
21
- rack (~> 1.5.2)
22
- rack-test (~> 0.6.2)
23
- activesupport (4.0.2)
24
- i18n (~> 0.6, >= 0.6.4)
25
- minitest (~> 4.2)
26
- multi_json (~> 1.3)
27
- thread_safe (~> 0.1)
28
- tzinfo (~> 0.3.37)
29
- atomic (1.1.14)
30
15
  awesome_print (1.2.0)
31
16
  binding_of_caller (0.7.2)
32
17
  debug_inspector (>= 0.0.1)
33
- builder (3.1.4)
18
+ byebug (2.7.0)
19
+ columnize (~> 0.3)
20
+ debugger-linecache (~> 1.2)
34
21
  coderay (1.1.0)
35
22
  colorize (0.6.0)
36
23
  columnize (0.3.6)
37
24
  debug_inspector (0.0.2)
38
- debugger (1.6.5)
39
- columnize (>= 0.3.1)
40
- debugger-linecache (~> 1.2.0)
41
- debugger-ruby_core_source (~> 1.3.1)
42
25
  debugger-linecache (1.2.0)
43
- debugger-ruby_core_source (1.3.1)
44
- erubis (2.7.0)
45
- i18n (0.6.9)
46
26
  method_source (0.8.2)
47
- minitest (4.7.5)
48
- multi_json (1.8.2)
49
- pry (0.9.12.4)
27
+ pry (0.9.12.6)
50
28
  coderay (~> 1.0)
51
29
  method_source (~> 0.8)
52
30
  slop (~> 3.4)
53
- pry-debugger (0.2.2)
54
- debugger (~> 1.3)
55
- pry (~> 0.9.10)
31
+ pry-byebug (1.3.2)
32
+ byebug (~> 2.7)
33
+ pry (~> 0.9.12)
56
34
  pry-doc (0.4.6)
57
35
  pry (>= 0.9)
58
36
  yard (>= 0.8)
59
- pry-rails (0.3.2)
60
- pry (>= 0.9.10)
61
37
  pry-stack_explorer (0.4.9.1)
62
38
  binding_of_caller (>= 0.7)
63
39
  pry (>= 0.9.11)
64
- rack (1.5.2)
65
- rack-test (0.6.2)
66
- rack (>= 1.0)
67
- railties (4.0.2)
68
- actionpack (= 4.0.2)
69
- activesupport (= 4.0.2)
70
- rake (>= 0.8.7)
71
- thor (>= 0.18.1, < 2.0)
72
- rake (10.1.1)
73
- slop (3.4.7)
74
- thor (0.18.1)
75
- thread_safe (0.1.3)
76
- atomic
77
- tzinfo (0.3.38)
78
- yard (0.8.7.3)
40
+ slop (3.5.0)
41
+ yard (0.8.7.4)
79
42
 
80
43
  PLATFORMS
81
44
  ruby
data/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  Icepick
2
2
  =======
3
- © {[doomspork](https://github.com/doomspork)} 2014
4
3
 
5
- Current version is `0.2.0` [Changelog][changelog].
4
+ [![Gem Version](https://badge.fury.io/rb/icepick.png)](https://rubygems.org/gems/icepick) [![Code Climate](https://codeclimate.com/github/doomspork/icepick.png)](https://codeclimate.com/github/doomspork/icepick)
5
+
6
+ [Changelog][changelog]
6
7
 
7
8
  __Icepick__ bundles a set of useful tools, plugins, and configurations together:
8
9
 
9
10
  * [Pry][pry] is a powerful alternative to IRB
10
11
  * [Pry Doc][pry-doc] includes documentation and source for Core Ruby components
11
- * [Pry Debugger][pry-debugger] brings the power of debugger to Pry
12
+ * [Pry Byebug][pry-byebug] brings the power of debugging to Pry
12
13
  * [Pry Stack Explorer][pry-stack_explorer] adds support for call stack navigation
13
- * [Pry Rails][pry-rails] adds Rails helpers to Pry like `show-routes` and `show-models`
14
14
  * [Awesome Print][awesome_print] colorizes and formats output
15
15
 
16
- Ruby 1.9.2+ only. Support included for Rails 3 and Rails 4.
16
+ Ruby 2.0.0+ only.
17
17
 
18
18
  ## Usage
19
19
 
@@ -32,18 +32,10 @@ if defined?(Icepick)
32
32
  end
33
33
  ```
34
34
  ------
35
- ### `name`
36
-
37
- Configures the prompt name, defaults to `Icepick`
38
-
39
35
  ### `separator`
40
36
 
41
37
  Change the prompt separator to something other than the default: `>`
42
38
 
43
- ### `formatted`
44
-
45
- Color and format the prompt, defaults to `true`
46
-
47
39
  ### `main_layout`
48
40
 
49
41
  Allows you to configure the layout for the main Pry prompt, defaults to `'{line_num}. {name}@{context} {separator} '`. The following placeholders are available for use in the layout:
@@ -60,9 +52,17 @@ Configuration for the Pry wait prompt, defaults to `'{spaces} {separator} '`. I
60
52
  * `spaces` - String of spaces equal to the length to the main prompt without the separator
61
53
  * `dots` - Similar to the above but dots
62
54
 
63
- ## Contributions
55
+ ## Contributing
56
+
57
+ Feedback and features welcome! Please make use of [Issues](https://github.com/doomspork/orwell/issues) and [Pull Requests](https://github.com/doomspork/orwell/pulls), all code must have accompanying specs.
58
+
59
+ ## Author/Contact
60
+
61
+ Icepick is written and maintained by [@doomspork](github.com/doomspork) with the help of [@jamesbrink](github.com/jamesbrink).
62
+
63
+ ## License
64
64
 
65
- Feel free to open [Issues][issues] or submit [Pull Requests][pullrequest] for consideration.
65
+ Icepick is made available under the [MIT](http://opensource.org/licenses/MIT) License.
66
66
 
67
67
  [issues]: https://github.com/doomspork/icepick/issues
68
68
  [pullrequest]: https://github.com/doomspork/icepick/pulls
@@ -70,7 +70,5 @@ Feel free to open [Issues][issues] or submit [Pull Requests][pullrequest] for co
70
70
  [pry]: http://pry.github.com
71
71
  [pry-doc]: https://github.com/pry/pry-doc
72
72
  [pry-stack_explorer]: https://github.com/pry/pry-stack_explorer
73
- [pry-debugger]: https://github.com/nixme/pry-debugger
74
73
  [pry-byebug]: https://github.com/deivid-rodriguez/pry-byebug
75
- [pry-rails]: https://github.com/rweng/pry-rails
76
74
  [awesome_print]: https://github.com/michaeldv/awesome_print
@@ -17,13 +17,11 @@ Gem::Specification.new do |gem|
17
17
  gem.require_paths = ['lib']
18
18
 
19
19
  # Dependencies
20
- gem.required_ruby_version = '>= 1.9.2'
20
+ gem.required_ruby_version = '>= 2.0.0'
21
21
  gem.add_runtime_dependency 'pry', '~> 0.9.12'
22
22
  gem.add_runtime_dependency 'pry-doc', '~> 0.4.6'
23
- gem.add_runtime_dependency 'pry-rails', '~> 0.3.2'
24
23
  gem.add_runtime_dependency 'pry-stack_explorer', '~> 0.4.9'
25
- gem.add_runtime_dependency 'pry-debugger', '~> 0.2.2'
24
+ gem.add_runtime_dependency 'pry-byebug', '~> 1.3.2'
26
25
  gem.add_runtime_dependency 'colorize', '~> 0.6.0'
27
26
  gem.add_runtime_dependency 'awesome_print', '~> 1.2'
28
- gem.add_runtime_dependency 'railties', '>= 3.0', '< 5.0'
29
27
  end
@@ -5,7 +5,7 @@ require 'icepick/prompt'
5
5
  require 'pry'
6
6
  require 'pry-doc'
7
7
  require 'pry-stack_explorer'
8
- require 'pry-debugger'
8
+ require 'pry-byebug'
9
9
  require 'awesome_print'
10
10
  require 'readline'
11
11
 
@@ -32,9 +32,6 @@ module Icepick
32
32
  # Returns nothing
33
33
  def self.initialize!(name = nil)
34
34
  silence_warnings do
35
- # Set the prompt name, for the Railtie this is the application name
36
- Prompt.config.name = name if name
37
-
38
35
  # Use awesome_print for Pry output
39
36
  Pry.config.print = ->(output, value) do
40
37
  pretty = value.ai(AWESOME_OPTS)
@@ -42,15 +39,16 @@ module Icepick
42
39
  end
43
40
 
44
41
  # Use Icepick's Prompt for Pry
45
- Pry.config.prompt = [Prompt.main_prompt, Prompt.wait_prompt]
42
+ Pry.config.prompt = Prompt.pry_prompts
46
43
 
47
- # Debugger shortcuts
48
- if defined?(PryDebugger)
49
- Pry.commands.alias_command 'c', 'continue'
50
- Pry.commands.alias_command 's', 'step'
51
- Pry.commands.alias_command 'n', 'next'
52
- Pry.commands.alias_command 'f', 'finish'
53
- end
44
+ # Debug aliases
45
+ Pry.commands.alias_command 'c', 'continue'
46
+ Pry.commands.alias_command 's', 'step'
47
+ Pry.commands.alias_command 'n', 'next'
48
+ Pry.commands.alias_command 'f', 'finish'
49
+ Pry.commands.alias_command 'e', 'exit'
50
+ Pry.commands.alias_command 'q', 'quit'
51
+ Pry.commands.alias_command '..', 'cd'
54
52
  end
55
53
  end
56
54
 
@@ -67,9 +65,4 @@ module Icepick
67
65
  end
68
66
  end
69
67
 
70
- if defined?(Rails)
71
- require 'pry-rails'
72
- require 'icepick/railtie'
73
- else
74
- Icepick.initialize!
75
- end
68
+ Icepick.initialize!
@@ -3,25 +3,16 @@ module Icepick
3
3
  # Separator for the prompt
4
4
  attr_accessor :separator
5
5
 
6
- # Whether or not to use colors and formatting
7
- attr_accessor :formatted
8
- alias :formatted? :formatted
9
-
10
6
  # The mustache compatiable layouts for Pry prompts
11
7
  attr_accessor :main_layout, :wait_layout
12
8
 
13
- # The prompt name
14
- attr_accessor :name
15
-
16
9
  # Public: Create a new instance of the config with defaults
17
10
  #
18
11
  # Returns a new instance
19
12
  def initialize
20
- self.separator = '>'
21
- self.formatted = true
22
- self.main_layout = '{line_num}. {name}@{context} {separator} '
13
+ self.separator = '>'.bold
14
+ self.main_layout = '{line_num}. {context.colorize(:cyan)} {separator} '
23
15
  self.wait_layout = '{spaces} {separator} '
24
- self.name = 'Icepick'
25
16
  end
26
17
  end
27
18
  end
@@ -20,6 +20,15 @@ module Icepick
20
20
  # Initialize the configuration object
21
21
  self.config = Icepick::Config.new
22
22
 
23
+ # Public: A helper for use when assigning the prompt's to Pry
24
+ #
25
+ # Returns an Array of prompts
26
+ def self.pry_prompts
27
+ [main_prompt, wait_prompt]
28
+ end
29
+
30
+ protected
31
+
23
32
  # Public: Piece together the main prompt
24
33
  #
25
34
  # Returns a Proc
@@ -34,8 +43,6 @@ module Icepick
34
43
  prompt_proc(config.wait_layout)
35
44
  end
36
45
 
37
- protected
38
-
39
46
  # Internal: Build a prompt proc for a given layout
40
47
  #
41
48
  # layout - The layout to use in the proc
@@ -62,35 +69,28 @@ module Icepick
62
69
  #
63
70
  # Returns the separator as a String
64
71
  def self.separator
65
- separator = config.separator
66
- config.formatted ? separator.bold : separator
72
+ config.separator
67
73
  end
68
74
 
69
75
  # Internal: Return the name with appropriate formatting
70
76
  #
71
77
  # Returns a String
72
78
  def self.name
73
- config.formatted? ? config.name.underline : config.name
79
+ config.name
74
80
  end
75
81
 
76
82
  # Internal: Helper for line number
77
83
  #
78
84
  # Returns the line number as String
79
85
  def self.line_num
80
- line = self.pry.input_array.size.to_s
81
- config.formatted? ? line.bold : line
86
+ self.pry.input_array.size.to_s
82
87
  end
83
88
 
84
89
  # Internal: Get the name of Pry's current context or target
85
90
  #
86
91
  # Returns a String
87
92
  def self.context
88
- unless (context = Pry.view_clip(target)) == 'main'
89
- str = "#{context.gsub(/::/, '/')}"
90
- config.formatted? ? str.colorize(:blue) : str
91
- else
92
- ''
93
- end
93
+ (context = Pry.view_clip(target)) == 'main' ? '~' : context.gsub(/::/, '/')
94
94
  end
95
95
 
96
96
  # Internal: Get a String of spaces matching the main prompt
@@ -112,11 +112,8 @@ module Icepick
112
112
  #
113
113
  # Returns an Integer
114
114
  def self.prompt_size
115
- old_setting = config.formatted?
116
- config.formatted = false
117
- prompt = main_prompt.call(self.target, self.level, self.pry)
118
- config.formatted = old_setting
119
- index = prompt.index(config.separator) - 2
115
+ prompt = main_prompt.call(self.target, self.level, self.pry).uncolorize.trim
116
+ index = prompt.index(config.separator) - 2
120
117
  prompt[0..index].length
121
118
  end
122
119
 
@@ -1,3 +1,3 @@
1
1
  module Icepick
2
- VERSION = '0.2.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,133 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icepick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Callan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-02 00:00:00.000000000 Z
11
+ date: 2014-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.12
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry-doc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.4.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.4.6
41
- - !ruby/object:Gem::Dependency
42
- name: pry-rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: 0.3.2
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 0.3.2
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: pry-stack_explorer
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - ~>
45
+ - - "~>"
60
46
  - !ruby/object:Gem::Version
61
47
  version: 0.4.9
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - ~>
52
+ - - "~>"
67
53
  - !ruby/object:Gem::Version
68
54
  version: 0.4.9
69
55
  - !ruby/object:Gem::Dependency
70
- name: pry-debugger
56
+ name: pry-byebug
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - ~>
59
+ - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: 0.2.2
61
+ version: 1.3.2
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - ~>
66
+ - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: 0.2.2
68
+ version: 1.3.2
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: colorize
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - ~>
73
+ - - "~>"
88
74
  - !ruby/object:Gem::Version
89
75
  version: 0.6.0
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - ~>
80
+ - - "~>"
95
81
  - !ruby/object:Gem::Version
96
82
  version: 0.6.0
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: awesome_print
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - ~>
87
+ - - "~>"
102
88
  - !ruby/object:Gem::Version
103
89
  version: '1.2'
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - ~>
94
+ - - "~>"
109
95
  - !ruby/object:Gem::Version
110
96
  version: '1.2'
111
- - !ruby/object:Gem::Dependency
112
- name: railties
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '>='
116
- - !ruby/object:Gem::Version
117
- version: '3.0'
118
- - - <
119
- - !ruby/object:Gem::Version
120
- version: '5.0'
121
- type: :runtime
122
- prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - '>='
126
- - !ruby/object:Gem::Version
127
- version: '3.0'
128
- - - <
129
- - !ruby/object:Gem::Version
130
- version: '5.0'
131
97
  description: Pry bundled with plugins and helpful configurations.
132
98
  email: seancallan@gmail.com
133
99
  executables:
@@ -135,8 +101,8 @@ executables:
135
101
  extensions: []
136
102
  extra_rdoc_files: []
137
103
  files:
138
- - .gitignore
139
- - .ruby-version
104
+ - ".gitignore"
105
+ - ".ruby-version"
140
106
  - CHANGELOG.md
141
107
  - Gemfile
142
108
  - Gemfile.lock
@@ -148,7 +114,6 @@ files:
148
114
  - lib/icepick.rb
149
115
  - lib/icepick/config.rb
150
116
  - lib/icepick/prompt.rb
151
- - lib/icepick/railtie.rb
152
117
  - lib/icepick/version.rb
153
118
  homepage: https://github.com/doomspork/icepick
154
119
  licenses:
@@ -160,17 +125,17 @@ require_paths:
160
125
  - lib
161
126
  required_ruby_version: !ruby/object:Gem::Requirement
162
127
  requirements:
163
- - - '>='
128
+ - - ">="
164
129
  - !ruby/object:Gem::Version
165
- version: 1.9.2
130
+ version: 2.0.0
166
131
  required_rubygems_version: !ruby/object:Gem::Requirement
167
132
  requirements:
168
- - - '>='
133
+ - - ">="
169
134
  - !ruby/object:Gem::Version
170
135
  version: '0'
171
136
  requirements: []
172
137
  rubyforge_project:
173
- rubygems_version: 2.0.2
138
+ rubygems_version: 2.0.14
174
139
  signing_key:
175
140
  specification_version: 4
176
141
  summary: Pry bundled with plugins and helpful configurations.
@@ -1,12 +0,0 @@
1
- module Icepick
2
- class Railtie < Rails::Railtie
3
- initializer 'icepick.initialize' do |app|
4
- Icepick.initialize!(app.class.parent_name.underscore)
5
-
6
- silence_warnings do
7
- # Use Pry instead of IRB
8
- IRB = Pry
9
- end
10
- end
11
- end
12
- end