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 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,9 @@
1
+ Description:
2
+ Seasons your app with a little fresh pepper for better security.
3
+
4
+ Example:
5
+ rails generate seasoning --devise
6
+
7
+ This will update:
8
+ config/initializers/secret_token.rb
9
+ config/initializers/devise.rb (optional)
@@ -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
- - 0
9
- version: 0.1.0
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: []