railyard 0.2.0 → 0.3.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: 8cfc94a5c12f2524538284f4d782266f1c8e4b85
4
- data.tar.gz: 27234a3415444a0a9f9fd5935436e6d4a397c61c
3
+ metadata.gz: 9fba1aa94dc3bd4007cb702d263d9451d96c5732
4
+ data.tar.gz: 846b11e45db07f891cf1c89d999ad85bce1f3f58
5
5
  SHA512:
6
- metadata.gz: 940bc11873d8b88e5ba40ba1886cfa64f16ab8b50bdf311491aeec907f4d12b5f745a7f610f4efbc6dc9e2db1c6b34ee1a0b4c66f3c8d7b19fa507bdedea06de
7
- data.tar.gz: 1bfc238cadbd2e23162e72556e99408cc1bf5ff5c0f88ccbfe142dd9786edb3da800e2baa28f02245b46dc444bbe2d84e47754126bc8843a3984899f83340a12
6
+ metadata.gz: fb90f974a32b419f3312ba4c1f91177c7de570c0402c89a0e46e22f6f7080b4c071736c364ad1f5eae16b5e5ecf384835b297bc77fe15fd4940a29ea56add1ae
7
+ data.tar.gz: 60fa970069054bad89a2f176bf8469d7bf82ef8d137700ffe42971e96aa45e4a6428b37529f109ade1bbf4dc5f5cc5ba361307a0b9e1662637a68b8a550e729f
data/README.md CHANGED
@@ -10,13 +10,18 @@ Install it globally with:
10
10
 
11
11
  ## Usage
12
12
 
13
- There are only two commands, `version` and `new`.
13
+ There are only three commands, `version`, `new`, and `plugin`.
14
14
 
15
15
  $ railyard version 4.1.1
16
16
  $ railyard new APP_NAME
17
+ $ railyard plugin PLUGIN_NAME
17
18
 
18
19
  Right now Railyard doesn't manage Ruby versions for you—Railyard runs in whatever Ruby version you've installed it on and are calling it from. You may be able to generate a skeleton for a version of Rails in a version of Ruby that Rails wasn't designed to run on, but it's recommended that you switch your Ruby version to one that is compatible with the version of Rails you're trying to generate a skeleton of.
19
20
 
21
+ ### Plugin command
22
+
23
+ The plugin command is used to generate a [Rails Engine](http://guides.rubyonrails.org/engines.html).
24
+
20
25
  ## Contributing
21
26
 
22
27
  1. Fork it ( https://github.com/brandonweiss/railyard/fork )
@@ -1,3 +1,3 @@
1
1
  module Railyard
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/railyard.rb CHANGED
@@ -46,6 +46,23 @@ module Railyard
46
46
  rails_new(args)
47
47
  end
48
48
 
49
+ desc "plugin [APP_PATH]", "Create a new Rails Engine"
50
+ def plugin(app_path = nil, *args)
51
+ if !installed?
52
+ puts "Installing Rails..."
53
+ install
54
+ end
55
+
56
+ if app_path && app_path !~ /^--?/
57
+ args.unshift expand_path(app_path)
58
+ args << "--skip-bundle" unless args.include?("--skip-bundle")
59
+ else
60
+ args << "--help"
61
+ end
62
+
63
+ rails_plugin(args)
64
+ end
65
+
49
66
  def help
50
67
  puts "railyard #{Railyard::VERSION}"
51
68
  super
@@ -57,6 +74,10 @@ module Railyard
57
74
  sandbox("bundle exec rails new #{args.join(' ')}")
58
75
  end
59
76
 
77
+ def rails_plugin(args)
78
+ sandbox("bundle exec rails plugin new #{args.join(' ')}")
79
+ end
80
+
60
81
  def installed?
61
82
  sandbox("bundle check > /dev/null")
62
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railyard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Weiss