coypond 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
-
3
+ gem 'ripper', :platforms => :ruby_18
4
4
 
5
5
  group :development do
6
6
  gem "shoulda", ">= 0"
data/Gemfile.lock CHANGED
@@ -8,6 +8,7 @@ GEM
8
8
  rake
9
9
  rake (0.9.2)
10
10
  rcov (0.9.10)
11
+ ripper (1.0.2)
11
12
  shoulda (2.11.3)
12
13
 
13
14
  PLATFORMS
@@ -17,4 +18,5 @@ DEPENDENCIES
17
18
  bundler (~> 1.0.0)
18
19
  jeweler (~> 1.6.4)
19
20
  rcov
21
+ ripper
20
22
  shoulda
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
data/bin/coypond CHANGED
@@ -49,7 +49,7 @@ options[:all] ||= (options.keys & [:class, :method, :module]).empty?
49
49
 
50
50
  def expand(file, pattern=["**"])
51
51
  if File.directory?(file)
52
- return Dir.glob(File.join(file, *pattern, '*.rb') )
52
+ return Dir.glob(File.join([file, pattern, "*.rb"].flatten) )
53
53
  else
54
54
  return file
55
55
  end
data/coypond.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{coypond}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Amit Levy"]
@@ -44,17 +44,20 @@ Gem::Specification.new do |s|
44
44
  s.specification_version = 3
45
45
 
46
46
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_runtime_dependency(%q<ripper>, [">= 0"])
47
48
  s.add_development_dependency(%q<shoulda>, [">= 0"])
48
49
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
49
50
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
50
51
  s.add_development_dependency(%q<rcov>, [">= 0"])
51
52
  else
53
+ s.add_dependency(%q<ripper>, [">= 0"])
52
54
  s.add_dependency(%q<shoulda>, [">= 0"])
53
55
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
54
56
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
55
57
  s.add_dependency(%q<rcov>, [">= 0"])
56
58
  end
57
59
  else
60
+ s.add_dependency(%q<ripper>, [">= 0"])
58
61
  s.add_dependency(%q<shoulda>, [">= 0"])
59
62
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
63
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
data/lib/coypond.rb CHANGED
@@ -13,10 +13,10 @@ module Coypond
13
13
  each_file do |file_name, source, parser|
14
14
  final_result[file_name] = []
15
15
  classes = modules = methods = {}
16
- classes = search_in_collection(parser.classes, options) if options[:class] || options[:all]
17
- modules = search_in_collection(parser.modules, options) if options[:module] || options[:all]
18
- methods = search_in_collection(parser.methods, options) if options[:method] || options[:all]
19
- result = classes.merge(modules.merge(methods))
16
+ classes = search_in_collection(parser.classes, options).to_a if options[:class] || options[:all]
17
+ modules = search_in_collection(parser.modules, options).to_a if options[:module] || options[:all]
18
+ methods = search_in_collection(parser.methods, options).to_a if options[:method] || options[:all]
19
+ result = Hash[classes + modules + methods]
20
20
  result.each do |dec, location|
21
21
  context = source.lines.to_a[location.first - 1]
22
22
  final_result[file_name] << [dec, location, context]
@@ -37,7 +37,7 @@ class TestParser < Test::Unit::TestCase
37
37
  [:void_stmt]], nil, nil, nil]]]]
38
38
  parser = Coypond::Parser.new.parse(parse_tree)
39
39
 
40
- assert_equal ["Foo", "Baz"], parser.classes.keys
40
+ assert_equal ["Baz", "Foo"], parser.classes.keys.sort
41
41
  end
42
42
 
43
43
  should "use fully qualified class name in classes instance variable" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coypond
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,9 +12,20 @@ cert_chain: []
12
12
  date: 2011-08-10 00:00:00.000000000 -07:00
13
13
  default_executable: coypond
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: ripper
17
+ requirement: &2157310080 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *2157310080
15
26
  - !ruby/object:Gem::Dependency
16
27
  name: shoulda
17
- requirement: &2156810780 !ruby/object:Gem::Requirement
28
+ requirement: &2157309600 !ruby/object:Gem::Requirement
18
29
  none: false
19
30
  requirements:
20
31
  - - ! '>='
@@ -22,10 +33,10 @@ dependencies:
22
33
  version: '0'
23
34
  type: :development
24
35
  prerelease: false
25
- version_requirements: *2156810780
36
+ version_requirements: *2157309600
26
37
  - !ruby/object:Gem::Dependency
27
38
  name: bundler
28
- requirement: &2156809820 !ruby/object:Gem::Requirement
39
+ requirement: &2157309120 !ruby/object:Gem::Requirement
29
40
  none: false
30
41
  requirements:
31
42
  - - ~>
@@ -33,10 +44,10 @@ dependencies:
33
44
  version: 1.0.0
34
45
  type: :development
35
46
  prerelease: false
36
- version_requirements: *2156809820
47
+ version_requirements: *2157309120
37
48
  - !ruby/object:Gem::Dependency
38
49
  name: jeweler
39
- requirement: &2156808340 !ruby/object:Gem::Requirement
50
+ requirement: &2157308640 !ruby/object:Gem::Requirement
40
51
  none: false
41
52
  requirements:
42
53
  - - ~>
@@ -44,10 +55,10 @@ dependencies:
44
55
  version: 1.6.4
45
56
  type: :development
46
57
  prerelease: false
47
- version_requirements: *2156808340
58
+ version_requirements: *2157308640
48
59
  - !ruby/object:Gem::Dependency
49
60
  name: rcov
50
- requirement: &2156807160 !ruby/object:Gem::Requirement
61
+ requirement: &2157308160 !ruby/object:Gem::Requirement
51
62
  none: false
52
63
  requirements:
53
64
  - - ! '>='
@@ -55,7 +66,7 @@ dependencies:
55
66
  version: '0'
56
67
  type: :development
57
68
  prerelease: false
58
- version_requirements: *2156807160
69
+ version_requirements: *2157308160
59
70
  description: Semantic grep for Ruby
60
71
  email: aalevy@gmail.com
61
72
  executables:
@@ -95,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
106
  version: '0'
96
107
  segments:
97
108
  - 0
98
- hash: -73129731692111590
109
+ hash: 3188914366153975721
99
110
  required_rubygems_version: !ruby/object:Gem::Requirement
100
111
  none: false
101
112
  requirements: