railyard 0.1.0 → 0.2.0

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: a423bd21bbfa46c3818a30badaed855b24931dc7
4
- data.tar.gz: c10f9583da02af9868ae0f82533e0ea77985ed1a
3
+ metadata.gz: 8cfc94a5c12f2524538284f4d782266f1c8e4b85
4
+ data.tar.gz: 27234a3415444a0a9f9fd5935436e6d4a397c61c
5
5
  SHA512:
6
- metadata.gz: 4845505dcdc568c51d865b229f5cbfd524a7bd4759529d46e812a874ef803bf6aef13edf9d1ba7074dfae6d2cc508610a32bedc7e7b7c5a7479d48632c38b367
7
- data.tar.gz: 2ed9d8f7520c6cdc3d9dc4e2cfb6aa7c34efcd34cf36ed4d7b624ef04fa4007d1ebc074524e4e864c002cf29f3d67517d7f65cb17ba73fa5f93cd71af22b335c
6
+ metadata.gz: 940bc11873d8b88e5ba40ba1886cfa64f16ab8b50bdf311491aeec907f4d12b5f745a7f610f4efbc6dc9e2db1c6b34ee1a0b4c66f3c8d7b19fa507bdedea06de
7
+ data.tar.gz: 1bfc238cadbd2e23162e72556e99408cc1bf5ff5c0f88ccbfe142dd9786edb3da800e2baa28f02245b46dc444bbe2d84e47754126bc8843a3984899f83340a12
data/README.md CHANGED
@@ -4,17 +4,7 @@ Generate Rails skeletons without having to globally install Rails and its bajill
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem "railyard"
11
- ```
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- Or install it yourself as:
7
+ Install it globally with:
18
8
 
19
9
  $ gem install railyard
20
10
 
@@ -29,7 +19,7 @@ Right now Railyard doesn't manage Ruby versions for you—Railyard runs in whate
29
19
 
30
20
  ## Contributing
31
21
 
32
- 1. Fork it ( https://github.com/[my-github-username]/railyard/fork )
22
+ 1. Fork it ( https://github.com/brandonweiss/railyard/fork )
33
23
  2. Create your feature branch (`git checkout -b my-new-feature`)
34
24
  3. Commit your changes (`git commit -am 'Add some feature'`)
35
25
  4. Push to the branch (`git push origin my-new-feature`)
@@ -6,23 +6,24 @@ module Railyard
6
6
  end
7
7
 
8
8
  def update_version(number)
9
- body = read
9
+ body = read
10
+ lines = body.split("\n")
11
+ rails = lines.find { |line| line =~ /rails/ }
10
12
 
11
- if match = body.match(/^gem \"rails\", \"(\d+(?:\.\d+(?:\.\d+)?)?)\"$/)
12
- body.gsub!(match[1], number)
13
+ if match = rails.match(/(\d[\d\.]{0,})/)
14
+ new_rails = rails.gsub(match[1], number)
13
15
  else
14
- body.gsub!(/, \"[\d\.]+\"/, "")
16
+ new_rails = "#{rails}, \"#{number}\""
15
17
  end
16
18
 
19
+ body = lines.join("\n") + "\n"
20
+ body.gsub!(rails, new_rails)
21
+
17
22
  write(body)
18
23
  end
19
24
 
20
25
  private
21
26
 
22
- def remove_version(body)
23
- body.gsub(/, \"[\d\.]+\"/, "")
24
- end
25
-
26
27
  def read
27
28
  File.read(@path)
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module Railyard
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/railyard.rb CHANGED
@@ -11,15 +11,22 @@ module Railyard
11
11
 
12
12
  desc "version [NUMBER]", "Show or change the Rails version"
13
13
  def version(number = nil)
14
- sandbox("bundle exec rails --version") and return unless number
14
+ if number
15
+ message = installed? ? "Changing Rails version..." : "Installing Rails..."
15
16
 
16
- Gemfile.new(gemfile_path).update_version(number)
17
+ Gemfile.new(gemfile_path).update_version(number)
18
+ puts message
17
19
 
18
- puts "Changing Rails version..."
19
- return if installed?
20
+ success = install
21
+ puts "Rails version #{number} doesn't appear to exist." unless success
22
+ else
23
+ if !installed?
24
+ puts "Installing Rails..."
25
+ install
26
+ end
20
27
 
21
- success = install
22
- puts "Rails version #{number} doesn't appear to exist." unless success
28
+ sandbox("bundle exec rails --version")
29
+ end
23
30
  end
24
31
 
25
32
  desc "new [APP_PATH]", "Create a new Rails application"
data/railyard.gemspec CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "rake", "~> 10.3.2"
22
22
 
23
- spec.add_dependency "bundler", "~> 1.7"
23
+ spec.add_dependency "bundler", "~> 1.8.3"
24
24
  spec.add_dependency "thor", "~> 0.19.1"
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railyard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Weiss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-29 00:00:00.000000000 Z
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.7'
33
+ version: 1.8.3
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
- version: '1.7'
40
+ version: 1.8.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement