seasoning 0.1.0 → 0.1.1
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/README.md +22 -0
- data/lib/generators/seasoning/USAGE +9 -0
- data/lib/generators/seasoning/seasoning_generator.rb +15 -0
- metadata +6 -4
data/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
= Seasoning
|
|
2
|
+
|
|
3
|
+
A Rails 3 generator to season your app.
|
|
4
|
+
|
|
5
|
+
== Install
|
|
6
|
+
|
|
7
|
+
gem install seasoning
|
|
8
|
+
|
|
9
|
+
== Usage
|
|
10
|
+
|
|
11
|
+
Once you install the gem, the generators will be available to any Rails application so long as you add the following to your Gemfile:
|
|
12
|
+
|
|
13
|
+
gem "seasoning"
|
|
14
|
+
|
|
15
|
+
After this has been added and you have run bundle install, you should be able to type:
|
|
16
|
+
|
|
17
|
+
rails g seasoning
|
|
18
|
+
|
|
19
|
+
Optionally, if you use Devise, which also uses a Pepper, do:
|
|
20
|
+
|
|
21
|
+
rails g seasoning --devise
|
|
22
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'rails/generators/base'
|
|
2
|
+
|
|
3
|
+
class SeasoningGenerator < Rails::Generators::Base #:nodoc:
|
|
4
|
+
require 'active_support/secure_random'
|
|
5
|
+
|
|
6
|
+
class_option :devise, :type => :boolean, :required => false, :aliases => "-d",
|
|
7
|
+
:default => false, :desc => "Also seasons devise"
|
|
8
|
+
|
|
9
|
+
def season_app
|
|
10
|
+
gsub_file 'config/initializers/secret_token.rb', /config.secret_token = \'[a-z0-9]+\'/, "config.secret_token = '#{ActiveSupport::SecureRandom.hex(64)}'"
|
|
11
|
+
if options[:devise]
|
|
12
|
+
gsub_file 'config/initializers/devise.rb', /config.pepper = \"([a-z0-9]+)\"/, "config.pepper = \"#{ActiveSupport::SecureRandom.hex(64)}\""
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 1
|
|
8
|
-
-
|
|
9
|
-
version: 0.1.
|
|
8
|
+
- 1
|
|
9
|
+
version: 0.1.1
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Aaron Kalin
|
|
@@ -26,8 +26,10 @@ extensions: []
|
|
|
26
26
|
|
|
27
27
|
extra_rdoc_files: []
|
|
28
28
|
|
|
29
|
-
files:
|
|
30
|
-
|
|
29
|
+
files:
|
|
30
|
+
- README.md
|
|
31
|
+
- lib/generators/seasoning/USAGE
|
|
32
|
+
- lib/generators/seasoning/seasoning_generator.rb
|
|
31
33
|
has_rdoc: true
|
|
32
34
|
homepage: http://github.com/martinisoft/seasoning
|
|
33
35
|
licenses: []
|