railyard 0.1.0 → 0.2.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 +4 -4
- data/README.md +2 -12
- data/lib/railyard/gemfile.rb +9 -8
- data/lib/railyard/version.rb +1 -1
- data/lib/railyard.rb +13 -6
- data/railyard.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cfc94a5c12f2524538284f4d782266f1c8e4b85
|
4
|
+
data.tar.gz: 27234a3415444a0a9f9fd5935436e6d4a397c61c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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/
|
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`)
|
data/lib/railyard/gemfile.rb
CHANGED
@@ -6,23 +6,24 @@ module Railyard
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def update_version(number)
|
9
|
-
body
|
9
|
+
body = read
|
10
|
+
lines = body.split("\n")
|
11
|
+
rails = lines.find { |line| line =~ /rails/ }
|
10
12
|
|
11
|
-
if match =
|
12
|
-
|
13
|
+
if match = rails.match(/(\d[\d\.]{0,})/)
|
14
|
+
new_rails = rails.gsub(match[1], number)
|
13
15
|
else
|
14
|
-
|
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
|
data/lib/railyard/version.rb
CHANGED
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
|
-
|
14
|
+
if number
|
15
|
+
message = installed? ? "Changing Rails version..." : "Installing Rails..."
|
15
16
|
|
16
|
-
|
17
|
+
Gemfile.new(gemfile_path).update_version(number)
|
18
|
+
puts message
|
17
19
|
|
18
|
-
|
19
|
-
|
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
|
-
|
22
|
-
|
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
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.
|
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:
|
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:
|
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:
|
40
|
+
version: 1.8.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|