rails_finder 0.0.2 → 0.0.3

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.
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Rails Finder Changelog
2
2
 
3
+ ## 0.0.3
4
+
5
+ [7 commits by 1 author](https://github.com/thorncp/rails_finder/compare/v0.0.2...v0.0.3)
6
+
7
+ * Sort output naturally by Rails version
8
+ * Add rake as dev dependency
9
+ * Build on [Travis](https://travis-ci.org/thorncp/rails_finder)
10
+
3
11
  ## 0.0.2
4
12
 
5
13
  [8 commits by 2 authors](https://github.com/thorncp/rails_finder/compare/v0.0.1...v0.0.2)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # RailsFinder
2
2
 
3
+ [![Build Status](https://travis-ci.org/thorncp/rails_finder.png)](https://travis-ci.org/thorncp/rails_finder)
4
+
3
5
  Finds Rails applications in a given directory and reports their version numbers.
4
6
 
5
7
  Currently, I maintain quite a lot of Rails applications, and the recent flux of
data/lib/rails_finder.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "rails_finder/version"
2
2
  require "rails_finder/app"
3
+ require "naturally"
3
4
 
4
5
  module RailsFinder
5
6
  def self.run(dir, output = $stdout)
@@ -16,7 +17,7 @@ module RailsFinder
16
17
 
17
18
  def print
18
19
  if apps.any?
19
- apps.sort_by(&:rails_version).each do |app|
20
+ apps.sort_by { |a| Naturally.normalize(a.rails_version) }.each do |app|
20
21
  output.puts "#{app.basename.ljust(root_width)} #{app.rails_version.ljust(version_width)} #{app.root}"
21
22
  end
22
23
  else
@@ -1,3 +1,3 @@
1
1
  module RailsFinder
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/rails_finder.gemspec CHANGED
@@ -17,5 +17,8 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
+ gem.add_dependency "naturally", "~> 1.0.3"
21
+
20
22
  gem.add_development_dependency "rspec", "~> 2.12.0"
23
+ gem.add_development_dependency "rake", "~> 10.0.3"
21
24
  end
@@ -78,4 +78,28 @@ describe RailsFinder do
78
78
  out.string.should include "valid_app_with_isolate"
79
79
  end
80
80
  end
81
+
82
+ it "sorts by rails version" do
83
+ Dir.mktmpdir "sorted" do |dir|
84
+ FileUtils.mkdir_p(File.join(dir, "app-one", "config"))
85
+ FileUtils.touch(File.join(dir, "app-one", "config", "environment.rb"))
86
+ File.open(File.join(dir, "app-one", "Gemfile"), "w") do |file|
87
+ file.puts "source :rubygems"
88
+ file.puts "gem 'rails', '3.2.12'"
89
+ end
90
+
91
+ FileUtils.mkdir_p(File.join(dir, "app-two", "config"))
92
+ FileUtils.touch(File.join(dir, "app-two", "config", "environment.rb"))
93
+ File.open(File.join(dir, "app-two", "Gemfile"), "w") do |file|
94
+ file.puts "source :rubygems"
95
+ file.puts "gem 'rails', '3.2.8'"
96
+ end
97
+
98
+ out = StringIO.new
99
+ RailsFinder.run(dir, out)
100
+ lines = out.string.split("\n")
101
+ lines[0].should include "3.2.8"
102
+ lines[1].should include "3.2.12"
103
+ end
104
+ end
81
105
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,6 +12,22 @@ bindir: bin
12
12
  cert_chain: []
13
13
  date: 2013-02-14 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: naturally
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.3
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: 1.0.3
15
31
  - !ruby/object:Gem::Dependency
16
32
  name: rspec
17
33
  requirement: !ruby/object:Gem::Requirement
@@ -28,6 +44,22 @@ dependencies:
28
44
  - - "~>"
29
45
  - !ruby/object:Gem::Version
30
46
  version: 2.12.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 10.0.3
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 10.0.3
31
63
  description: Overly simple utility to recursively find Rails apps and their versions
32
64
  email:
33
65
  - thorncp@gmail.com
@@ -38,6 +70,7 @@ extensions: []
38
70
  extra_rdoc_files: []
39
71
  files:
40
72
  - ".gitignore"
73
+ - ".travis.yml"
41
74
  - CHANGELOG.md
42
75
  - Gemfile
43
76
  - LICENSE.txt
@@ -68,12 +101,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
101
  - - ">="
69
102
  - !ruby/object:Gem::Version
70
103
  version: '0'
104
+ segments:
105
+ - 0
106
+ hash: -4512652221694680449
71
107
  required_rubygems_version: !ruby/object:Gem::Requirement
72
108
  none: false
73
109
  requirements:
74
110
  - - ">="
75
111
  - !ruby/object:Gem::Version
76
112
  version: '0'
113
+ segments:
114
+ - 0
115
+ hash: -4512652221694680449
77
116
  requirements: []
78
117
  rubyforge_project:
79
118
  rubygems_version: 1.8.25