venus 0.6.2 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. data/README.md +16 -9
  2. data/lib/generators/venus/bootstrap/bootstrap_generator.rb +15 -3
  3. data/lib/generators/venus/bootstrap/templates/simple_form_config.erb +11 -0
  4. data/lib/generators/venus/carrierwave/carrierwave_generator.rb +2 -2
  5. data/lib/generators/venus/chosen/templates/chosen.js +2 -1
  6. data/lib/generators/venus/devise/devise_generator.rb +7 -10
  7. data/lib/generators/venus/helpers.rb +4 -4
  8. data/lib/generators/venus/jqueryui/templates/datepicker.js +2 -1
  9. data/lib/generators/venus/omniauth/omniauth_generator.rb +10 -7
  10. data/lib/generators/venus/omniauth/templates/migrations.rb.erb +7 -0
  11. data/lib/generators/venus/omniauth/templates/{omniauth.rb → omniauth.rb.erb} +1 -1
  12. data/lib/generators/venus/omniauth/templates/omniauth_callbacks_controller.rb.erb +20 -0
  13. data/lib/generators/venus/omniauth/templates/omniauthable.rb +9 -9
  14. data/lib/generators/venus/omniauth/templates/routes.erb +3 -3
  15. data/lib/generators/venus/sidekiq/sidekiq_generator.rb +71 -0
  16. data/lib/generators/venus/sidekiq/templates/deploy.erb +6 -0
  17. data/lib/generators/venus/sidekiq/templates/devise_async.erb +2 -0
  18. data/lib/generators/venus/sidekiq/templates/routes.erb +5 -0
  19. data/lib/generators/venus/sidekiq/templates/settings.erb +3 -0
  20. data/lib/generators/venus/sidekiq/templates/sidekiq.erb +9 -0
  21. data/lib/generators/venus/sidekiq/templates/sidekiq.yml +7 -0
  22. data/lib/generators/venus/simple_form/templates/nested_form_event.js +2 -1
  23. data/lib/generators/venus/versioning/templates/paper_trail.rb.erb +20 -0
  24. data/lib/generators/venus/versioning/versioning_generator.rb +32 -0
  25. data/lib/venus/version.rb +2 -2
  26. metadata +16 -6
  27. data/lib/generators/venus/omniauth/templates/migrations.rb +0 -7
  28. data/lib/generators/venus/omniauth/templates/omniauth_callbacks_controller.rb +0 -15
data/README.md CHANGED
@@ -10,7 +10,7 @@ Installation
10
10
  ```ruby
11
11
  group :development do
12
12
  ...
13
- gem 'venus', '~> 0.5.2'
13
+ gem 'venus', '~> 0.7.1'
14
14
  ...
15
15
  end
16
16
  ```
@@ -20,7 +20,7 @@ end
20
20
  ```ruby
21
21
  group :development do
22
22
  ...
23
- gem 'venus', :git => 'git@github.com:marsz/venus.git'
23
+ gem 'venus', :git => 'git://github.com/marsz/venus.git'
24
24
  ...
25
25
  end
26
26
  ```
@@ -30,6 +30,18 @@ end
30
30
  Usage
31
31
  =====
32
32
 
33
+ * `sidekiq` for background job
34
+
35
+ ```
36
+ rails generate venus:sidekiq
37
+ ```
38
+
39
+ * `paper_trail` for model versioning
40
+
41
+ ```
42
+ rails generate venus:versioning
43
+ ```
44
+
33
45
  * `Twitter Bootstrap` theme and `Unicorn Admin` optional.
34
46
 
35
47
  ```
@@ -123,17 +135,12 @@ Usage
123
135
  TODO
124
136
  ====
125
137
 
138
+ * Unicorn setup for capistrano.
126
139
  * MongoDB configuration.
127
140
  * RailsAdmin or ActiveAdmin.
128
- * Sidekiq for background job.
129
141
  * Amazon Elastic Cache & cells.
130
142
 
131
- Thanks
132
- ======
133
-
134
- Idea is from xdite/bootstrappers (https://github.com/xdite/bootstrappers).
135
-
136
143
  Contribution
137
144
  ============
138
145
 
139
- Just send pull request :)
146
+ Just send pull request :)
@@ -12,6 +12,8 @@ module Venus
12
12
  @target_css = ask?('target content append for css file?', 'application.css')
13
13
  @example_layout = ask?("Export example layout", 'bootstrap')
14
14
  @unicorn = ask?("Use theme unicorn admin", true)
15
+ say 'checking dependent gems "simple_form"...'
16
+ generate 'venus:simple_form' unless has_gem?('simple_form')
15
17
  end
16
18
 
17
19
  def gemfile
@@ -37,20 +39,30 @@ module Venus
37
39
  end
38
40
  end
39
41
 
42
+ def simple_form_config
43
+ to_file = "config/initializers/simple_form.rb"
44
+ insert_template(to_file, "simple_form_config.erb", :before => "\nend\n") if has_file?(to_file)
45
+ end
46
+
40
47
  def copy_example_layout
41
48
  to_file = "app/views/layouts/#{@example_layout}.html.erb"
42
49
  copy_file("img/glyphicons-halflings-white.png", "app/assets/images/img/glyphicons-halflings-white.png")
43
50
  copy_file("img/glyphicons-halflings.png", "app/assets/images/img/glyphicons-halflings.png")
44
51
  if @unicorn
45
- copy_file("unicorn.layout", to_file)
52
+ unicorn_file = "app/views/layouts/admin_unicorn.html.erb"
53
+ copy_file("unicorn.layout", unicorn_file)
54
+ replace_in_file(unicorn_file, "@target_css", @target_css)
55
+ replace_in_file(unicorn_file, "@target_js", @target_js)
46
56
  copy_file("img/breadcrumb.png", "app/assets/images/img/breadcrumb.png")
47
57
  copy_file("img/menu-active.png", "app/assets/images/img/menu-active.png")
48
58
  puts "see more uncorn admin example: http://wrapbootstrap.com/preview/WB0F35928"
49
- else
50
- copy_file("bootstrap.layout", to_file)
51
59
  end
60
+ # copy origin bootstrap layout
61
+ @unicorn = false
62
+ copy_file("bootstrap.layout", to_file)
52
63
  replace_in_file(to_file, "@target_css", @target_css)
53
64
  replace_in_file(to_file, "@target_js", @target_js)
65
+
54
66
  puts "see more bootdtrap usage: http://twitter.github.com/bootstrap/"
55
67
  end
56
68
 
@@ -0,0 +1,11 @@
1
+
2
+ config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
3
+ config.form_class = "form-horizontal"
4
+ b.use :placeholder
5
+ b.use :label, :wrap_with => { :class => 'control-label' }
6
+ b.wrapper :tag => 'div', :class => 'controls' do |ba|
7
+ ba.use :input
8
+ ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
9
+ ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
10
+ end
11
+ end
@@ -8,13 +8,13 @@ module Venus
8
8
  end
9
9
 
10
10
  def asks
11
+ @rails_version = ask?("your rails version?", '3.2')
12
+ @rails_version = @rails_version.index("3.2") == 0 ? '3.2' : '3.1'
11
13
  @imagemagick = ask?("Use imagemagick to resize picture?", true)
12
14
  @carrierwave_meta = ask?("Install gem 'carrierwave-meta'", true)
13
15
  @sample_uploader = ask?("Generate sample uploader?", 'venus')
14
16
  @fog = ask?("Use fog to upload file to AWS S3", true)
15
17
  if @fog
16
- @rails_version = ask?("your rails version?", '3.2')
17
- @rails_version = @rails_version.index("3.2") == 0 ? '3.2' : '3.1'
18
18
  say 'checking dependent gems "settinglogic"...'
19
19
  generate 'venus:settingslogic' unless has_gem?('settingslogic')
20
20
  @settinglogic_class = ask?("Your settinglogic class name?", 'Setting')
@@ -1,3 +1,4 @@
1
+
1
2
  $(document).ready(function() {
2
3
  $('select.chosen').chosen();
3
- });
4
+ });
@@ -9,28 +9,25 @@ module Venus
9
9
 
10
10
  def asks
11
11
  @views = ask?("Generate views?", false)
12
- # if @views == 'y' && has_gem?('haml')
13
- # @haml = ask("Use haml? [Y/n]").downcase
14
- # end
12
+ @model_name = ask?("model class?", 'User')
15
13
  end
16
14
 
17
15
  def gemfile
18
- add_gem('devise', "~> 2.1.2")
19
- bundle_install
16
+ unless has_gem?('devise')
17
+ @version = ask?('devise version?', '2.2.3')
18
+ add_gem('devise', "~> #{@version}")
19
+ bundle_install
20
+ end
20
21
  end
21
22
 
22
23
  def generates
23
24
  generate 'devise:install'
24
- generate 'devise User'
25
+ generate "devise #{@model_name}"
25
26
  end
26
27
 
27
28
  def views
28
29
  if @views
29
30
  generate 'devise:views -e erb'
30
- # if @haml != 'n'
31
- # run 'gem install haml hpricot ruby_parser'
32
- # run "for i in `find app/views/devise -d -name '*.erb'` ; do html2haml -e $i ${i%erb}haml ; rm $i ; done"
33
- # end
34
31
  end
35
32
  end
36
33
 
@@ -142,12 +142,12 @@ module Venus
142
142
  unless file_has_content?(to_file, " #{key}:")
143
143
  value = '' if opts[:hide_in_example] && to_file.index('.example')
144
144
  value = ask?("value of #{key} in #{to_file}#{opts[:hint] ? " (#{opts[:hint]})" : ""}", '') if value == :ask
145
- value = "'#{value}'" if value
145
+ inserted_value = (value.index("\n") ? value : "\"#{value}\"") if value
146
146
  if file_has_content?(to_file, "defaults: &defaults\n")
147
- insert_line_into_file(to_file, " #{key}: #{value}", :after => "defaults: &defaults")
147
+ insert_line_into_file(to_file, " #{key}: #{inserted_value}", :after => "defaults: &defaults")
148
148
  else
149
- insert_line_into_file(to_file, " #{key}: #{value}", :after => "development:")
150
- insert_line_into_file(to_file, " #{key}: #{value}", :after => "test:")
149
+ insert_line_into_file(to_file, " #{key}: #{inserted_value}", :after => "development:")
150
+ insert_line_into_file(to_file, " #{key}: #{inserted_value}", :after => "test:")
151
151
  end
152
152
  return value
153
153
  end
@@ -1,5 +1,6 @@
1
+
1
2
  $(document).ready(function() {
2
3
  $('.datepicker').datepicker({
3
4
  dateFormat: "yy-mm-dd"
4
5
  });
5
- });
6
+ });
@@ -10,12 +10,12 @@ module Venus
10
10
  def asks
11
11
  say 'checking dependent gems "settinglogic"...'
12
12
  generate 'venus:settingslogic' unless has_gem?('settingslogic')
13
- say 'checking dependent gems "devise"...'
14
- generate 'venus:devise' unless has_gem?('devise')
15
13
 
16
14
  @settinglogic_class = ask?("Your settinglogic class name?", 'Setting')
17
15
  @settinglogic_yml = ask?("Your settinglogic yaml file in config/ ?", 'setting.yml')
18
-
16
+ @devise_model = ask?("Devise model name?", 'User')
17
+ @devise_scope = @devise_model.underscore
18
+ @devise_table = @devise_model.tableize
19
19
  @providers = {}
20
20
  [:facebook, :github, :twitter].each do |provider|
21
21
  if ask?("Use '#{provider}'?", true)
@@ -24,6 +24,9 @@ module Venus
24
24
  @providers[provider] = {:token => token, :secret => secret}
25
25
  end
26
26
  end
27
+
28
+ say 'checking dependent gems "devise" with yout model scope "' + @devise_scope.to_s + '"...'
29
+ generate 'venus:devise' unless has_gem?('devise') && has_file?("app/models/#{@devise_scope}.rb")
27
30
  end
28
31
 
29
32
  def gemfile
@@ -35,12 +38,12 @@ module Venus
35
38
  end
36
39
 
37
40
  def controller
38
- template 'omniauth_callbacks_controller.rb', 'app/controllers/users/omniauth_callbacks_controller.rb', :force => true
41
+ template 'omniauth_callbacks_controller.rb.erb', "app/controllers/#{@devise_table}/omniauth_callbacks_controller.rb", :force => true
39
42
  end
40
43
 
41
44
  def configs
42
45
  insert_template('config/routes.rb', 'routes.erb', :after => "routes.draw do\n")
43
- template 'omniauth.rb', 'config/initializers/omniauth.rb'
46
+ template 'omniauth.rb.erb', 'config/initializers/omniauth.rb'
44
47
  ["config/#{@settinglogic_yml}", "config/#{@settinglogic_yml}.example"].each do |to_file|
45
48
  insert_template(to_file, "setting.yml.erb", :after => "&defaults\n")
46
49
  end
@@ -50,9 +53,9 @@ module Venus
50
53
  generate "model authorization provider:string uid:string auth_type:string auth_id:integer auth_data:text"
51
54
  insert_template 'app/models/authorization.rb', 'authorization.rb', :after => "ActiveRecord::Base\n"
52
55
  template 'omniauthable.rb', 'app/lib/omniauthable.rb'
53
- insert_template("app/models/user.rb", "user.erb", :before => "\nend\n")
56
+ insert_template("app/models/#{@devise_scope}.rb", "user.erb", :before => "\nend\n")
54
57
  sleep(1)
55
- migration_template "migrations.rb", "db/migrate/add_index_for_authorizations_and_add_column_for_users"
58
+ migration_template "migrations.rb.erb", "db/migrate/add_index_for_authorizations_and_add_column_for_#{@devise_table}"
56
59
  end
57
60
 
58
61
  def msg
@@ -0,0 +1,7 @@
1
+ class AddIndexForAuthorizationsAndAddColumnFor<%= @devise_table.camelize %> < ActiveRecord::Migration
2
+ def change
3
+ add_column :<%= @devise_table %>, :name, :string, :after => :email
4
+ add_index :authorizations, [:provider, :uid]
5
+ add_index :authorizations, [:auth_type, :auth_id]
6
+ end
7
+ end
@@ -4,4 +4,4 @@ Rails.application.config.middleware.use OmniAuth::Builder do
4
4
  end
5
5
  end
6
6
 
7
- OmniAuth.config.path_prefix = '/users/auth'
7
+ OmniAuth.config.path_prefix = '/<%= @devise_table %>/auth'
@@ -0,0 +1,20 @@
1
+ class <%= @devise_model.pluralize %>::OmniauthCallbacksController < ApplicationController
2
+
3
+ def callback
4
+ provider = params[:provider]
5
+ if not current_<%= @devise_scope %>.blank?
6
+ current_<%= @devise_scope %>.bind_service(env["omniauth.auth"])
7
+ sign_in_and_redirect(current_<%= @devise_scope %>, :notice => "Successfully binded to #{provider}.")
8
+ else
9
+ @<%= @devise_scope %> = <%= @devise_model %>.find_or_create_by_omniauth(env["omniauth.auth"])
10
+ flash[:notice] = "Sign in with #{provider.to_s.titleize} successfully."
11
+ sign_in_and_redirect @<%= @devise_scope %>, :event => :authentication, :notice => "Login successfully."
12
+ end
13
+ end
14
+
15
+ def failure
16
+ flash[:error] = params[:message]
17
+ redirect_to root_path
18
+ end
19
+
20
+ end
@@ -10,28 +10,28 @@ module Omniauthable
10
10
  def find_or_create_by_omniauth(authhash)
11
11
  authorization = Authorization.find_by_provider_and_uid(authhash['provider'], authhash['uid'])
12
12
  return authorization.auth if authorization
13
- user = send "initialize_from_omniauth_#{authhash['provider']}", authhash
14
- if User.find_by_email(user.email)
15
- user = _
13
+ instance = send "initialize_from_omniauth_#{authhash['provider']}", authhash
14
+ if self.find_by_email(instance.email)
15
+ instance = _
16
16
  else
17
- user.save
18
- user.bind_service(authhash)
17
+ instance.save
18
+ instance.bind_service(authhash)
19
19
  end
20
- user
20
+ instance
21
21
  end
22
22
 
23
23
  private
24
24
 
25
25
  def initialize_from_omniauth_facebook(authhash)
26
- User.new(:email => authhash['info']['email'], :name => authhash['info']['name'])
26
+ self.new(:email => authhash['info']['email'], :name => authhash['info']['name'])
27
27
  end
28
28
 
29
29
  def initialize_from_omniauth_twitter(authhash)
30
- User.new(:email => authhash['info']['email'], :name => authhash['info']['name'])
30
+ self.new(:email => authhash['info']['email'], :name => authhash['info']['name'])
31
31
  end
32
32
 
33
33
  def initialize_from_omniauth_github(authhash)
34
- User.new(:email => authhash['info']['email'], :name => authhash['info']['name'])
34
+ self.new(:email => authhash['info']['email'], :name => authhash['info']['name'])
35
35
  end
36
36
 
37
37
  end
@@ -1,7 +1,7 @@
1
1
 
2
- match '/users/auth/:provider/callback', :to => "users/omniauth_callbacks#callback"
3
- match '/users/auth/failure' => 'sessions#failure', :as => :auth_failure
2
+ match '/<%= @devise_table %>/auth/:provider/callback', :to => "<%= @devise_table %>/omniauth_callbacks#callback"
3
+ match '/<%= @devise_table %>/auth/failure' => "<%= @devise_table %>/omniauth_callbacks#failure", :as => :auth_failure
4
4
 
5
5
  Setting.providers.each do |provider|
6
- match "/users/auth/#{provider}", :as => "user_auth_#{provider}"
6
+ match "/<%= @devise_table %>/auth/#{provider}", :as => "<%= @devise_scope %>_auth_#{provider}"
7
7
  end
@@ -0,0 +1,71 @@
1
+ module Venus
2
+ module Generators
3
+ class SidekiqGenerator < Base
4
+ desc "Setup for sidekiq"
5
+
6
+ def name
7
+ "venus-sidekiq"
8
+ end
9
+
10
+ def asks
11
+ say 'checking dependent gems "settinglogic"...'
12
+ generate 'venus:settingslogic' unless has_gem?('settingslogic')
13
+ @settinglogic_class = ask?("Your settinglogic class name?", 'Setting')
14
+ @settinglogic_yml = ask?("Your settinglogic yaml file in config/ ?", 'setting.yml')
15
+
16
+ @redis_uri = ask?("redis server uri with db", "redis://127.0.0.1:6379/0")
17
+ @namespace = ask?("sidekiq namespace", app_name)
18
+
19
+ if has_gem?('devise')
20
+ @devise_scope = ask?("devise scope", "user")
21
+ @devise_async = ask?("setup devise async", true)
22
+ end
23
+
24
+ end
25
+
26
+ def gemfile
27
+ add_gem('sidekiq', '~> 2.8.0')
28
+ add_gem('slim')
29
+ add_gem('sinatra', '>= 1.3.0')
30
+ add_gem('devise-async', "~> 0.7.0") if @devise_async
31
+ bundle_install
32
+ end
33
+
34
+ def settingslogic
35
+ content = load_template("settings.erb")
36
+ to_file = "config/#{@settinglogic_yml}"
37
+ insert_into_setting_yml(to_file, "sidekiq", content) unless file_has_content?(to_file, "\n sidekiq:")
38
+ insert_into_setting_yml("#{to_file}.example", "sidekiq", content) unless file_has_content?("#{to_file}.example", "\n sidekiq:")
39
+ end
40
+
41
+ def insert_initializer
42
+ template 'sidekiq.erb', 'config/initializers/sidekiq.rb'
43
+ end
44
+
45
+ def routes
46
+ unless file_has_content?("config/routes.rb", 'sidekiq/web')
47
+ require_line = "require 'sidekiq/web'\n"
48
+ insert_line_into_file("config/routes.rb", require_line, :before => /[A-Za-z0-9]+::Application\.routes\.draw/)
49
+ end
50
+ route load_template("routes.erb")
51
+ end
52
+
53
+ def devise_async
54
+ if @devise_async
55
+ insert_line_into_file("app/models/#{@devise_scope}.rb", " devise :async\n", :after => "ActiveRecord::Base\n")
56
+ initializer("devise_async.rb", load_template('devise_async.erb'))
57
+ end
58
+ end
59
+
60
+ def capistrano
61
+ if has_gem?('capistrano')
62
+ content = load_template("deploy.erb")
63
+ to_file = "config/deploy.rb"
64
+ append_file(to_file, content) unless file_has_content?(to_file, content)
65
+ template 'sidekiq.yml', "config/sidekiq.yml"
66
+ end
67
+ end
68
+
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,6 @@
1
+
2
+
3
+ set :sidekiq_cmd, "bundle exec sidekiq"
4
+ set :sidekiqctl_cmd, "bundle exec sidekiqctl"
5
+
6
+ require 'sidekiq/capistrano'
@@ -0,0 +1,2 @@
1
+ # see more in https://github.com/mperham/sidekiq/wiki/devise
2
+ Devise::Async.backend = :sidekiq
@@ -0,0 +1,5 @@
1
+ # see more devise authentication: https://github.com/mperham/sidekiq/wiki/Monitoring
2
+ sidekiq_constraints = lambda{ |req| <%= "req.env['warden'].authenticate!({ :scope => :#{@devise_scope} })" if @devise_scope.present? %> }
3
+ constraints sidekiq_constraints do
4
+ mount Sidekiq::Web => '/sidekiq'
5
+ end
@@ -0,0 +1,3 @@
1
+
2
+ redis: "<%= @redis_uri %>"
3
+ namespace: "<%= @namespace %>"
@@ -0,0 +1,9 @@
1
+ Sidekiq.configure_server do |config|
2
+ config.redis = { :url => <%= @settinglogic_class %>.sidekiq[:redis], :namespace => <%= @settinglogic_class %>.sidekiq[:namespace] }
3
+ end
4
+
5
+ # When in Unicorn, this block needs to go in unicorn's `after_fork` callback:
6
+ Sidekiq.configure_client do |config|
7
+ config.redis = { :url => <%= @settinglogic_class %>.sidekiq[:redis], :namespace => <%= @settinglogic_class %>.sidekiq[:namespace] }
8
+ end
9
+
@@ -0,0 +1,7 @@
1
+ ---
2
+ :verbose: false
3
+ :concurrency: 1
4
+ staging:
5
+ :concurrency: 1
6
+ production:
7
+ :concurrency: 1
@@ -1,7 +1,8 @@
1
+
1
2
  $(document).on('nested:fieldAdded', function(event){
2
3
  // this field was just inserted into your form
3
4
  var field = event.field;
4
5
  // it's a jQuery object already! Now you can find date input
5
6
  // var dateField = field.find('.date');
6
7
  // dateField.datepicker(); // and activate datepicker on it
7
- })
8
+ })
@@ -0,0 +1,20 @@
1
+ class Version < ActiveRecord::Base
2
+ # add custom meta columns:
3
+ # 1. Add your metadata columns to the versions table.
4
+ # 2. Declare your metadata columns using attr_accessible
5
+ # attr_accessible :author_id, :word_count, :answer
6
+ end
7
+
8
+ # custome whodunit value:
9
+ # insert following code to application_controller.rb
10
+ #
11
+ # def user_for_paper_trail
12
+ # logged_in? ? current_member : 'Public user' # or whatever
13
+ # end
14
+
15
+
16
+ <% if @differ %>
17
+ require 'differ/string'
18
+ # example for diff output as html
19
+ # ("Bob" - "Boo").format_as(:html)
20
+ <% end %>
@@ -0,0 +1,32 @@
1
+ module Venus
2
+ module Generators
3
+ class VersioningGenerator < Base
4
+ desc "Setup paper_trail for model versioning"
5
+
6
+ def name
7
+ "paper_trail"
8
+ end
9
+
10
+ def asks
11
+ @differ = ask?("install differ?", true)
12
+ end
13
+
14
+ def gemfile
15
+ add_gem('paper_trail', '~> 2.7.1')
16
+ add_gem('differ', '~> 0.1.2') if @differ
17
+ bundle_install
18
+ generate 'paper_trail:install --with-changes'
19
+ bundle_exec 'rake db:migrate' if ask?("run db migrate", true)
20
+ end
21
+
22
+ def template_files
23
+ template("paper_trail.rb.erb", "config/initializers/paper_trail.rb")
24
+ end
25
+
26
+ def more_info
27
+ puts "see more: https://github.com/airblade/paper_trail"
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Venus
2
- VERSION = "0.6.2"
3
- end
2
+ VERSION = "0.7.1"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: venus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-11 00:00:00.000000000 Z
12
+ date: 2013-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -84,6 +84,7 @@ files:
84
84
  - lib/generators/venus/bootstrap/templates/img/glyphicons-halflings-white.png
85
85
  - lib/generators/venus/bootstrap/templates/img/glyphicons-halflings.png
86
86
  - lib/generators/venus/bootstrap/templates/img/menu-active.png
87
+ - lib/generators/venus/bootstrap/templates/simple_form_config.erb
87
88
  - lib/generators/venus/bootstrap/templates/unicorn.grey.css
88
89
  - lib/generators/venus/bootstrap/templates/unicorn.js
89
90
  - lib/generators/venus/bootstrap/templates/unicorn.layout
@@ -110,9 +111,9 @@ files:
110
111
  - lib/generators/venus/mysql/templates/database.yml.erb
111
112
  - lib/generators/venus/omniauth/omniauth_generator.rb
112
113
  - lib/generators/venus/omniauth/templates/authorization.rb
113
- - lib/generators/venus/omniauth/templates/migrations.rb
114
- - lib/generators/venus/omniauth/templates/omniauth.rb
115
- - lib/generators/venus/omniauth/templates/omniauth_callbacks_controller.rb
114
+ - lib/generators/venus/omniauth/templates/migrations.rb.erb
115
+ - lib/generators/venus/omniauth/templates/omniauth.rb.erb
116
+ - lib/generators/venus/omniauth/templates/omniauth_callbacks_controller.rb.erb
116
117
  - lib/generators/venus/omniauth/templates/omniauthable.rb
117
118
  - lib/generators/venus/omniauth/templates/routes.erb
118
119
  - lib/generators/venus/omniauth/templates/setting.yml.erb
@@ -127,8 +128,17 @@ files:
127
128
  - lib/generators/venus/settingslogic/settingslogic_generator.rb
128
129
  - lib/generators/venus/settingslogic/templates/setting.erb
129
130
  - lib/generators/venus/settingslogic/templates/setting.yml
131
+ - lib/generators/venus/sidekiq/sidekiq_generator.rb
132
+ - lib/generators/venus/sidekiq/templates/deploy.erb
133
+ - lib/generators/venus/sidekiq/templates/devise_async.erb
134
+ - lib/generators/venus/sidekiq/templates/routes.erb
135
+ - lib/generators/venus/sidekiq/templates/settings.erb
136
+ - lib/generators/venus/sidekiq/templates/sidekiq.erb
137
+ - lib/generators/venus/sidekiq/templates/sidekiq.yml
130
138
  - lib/generators/venus/simple_form/simple_form_generator.rb
131
139
  - lib/generators/venus/simple_form/templates/nested_form_event.js
140
+ - lib/generators/venus/versioning/templates/paper_trail.rb.erb
141
+ - lib/generators/venus/versioning/versioning_generator.rb
132
142
  - lib/venus.rb
133
143
  - lib/venus/version.rb
134
144
  - venus.gemspec
@@ -152,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
162
  version: '0'
153
163
  requirements: []
154
164
  rubyforge_project:
155
- rubygems_version: 1.8.24
165
+ rubygems_version: 1.8.25
156
166
  signing_key:
157
167
  specification_version: 3
158
168
  summary: Use rails generator to install and setup rubygems such as rspec, devise,
@@ -1,7 +0,0 @@
1
- class AddIndexForAuthorizationsAndAddColumnForUsers < ActiveRecord::Migration
2
- def change
3
- add_column :users, :name, :string, :after => :email
4
- add_index :authorizations, [:provider, :uid]
5
- add_index :authorizations, [:auth_type, :auth_id]
6
- end
7
- end
@@ -1,15 +0,0 @@
1
- class Users::OmniauthCallbacksController < ApplicationController
2
-
3
- def callback
4
- provider = params[:provider]
5
- if not current_user.blank?
6
- current_user.bind_service(env["omniauth.auth"])
7
- sign_in_and_redirect(current_user, :notice => "Successfully binded to #{provider}.")
8
- else
9
- @user = User.find_or_create_by_omniauth(env["omniauth.auth"])
10
- flash[:notice] = "Sign in with #{provider.to_s.titleize} successfully."
11
- sign_in_and_redirect @user, :event => :authentication, :notice => "Login successfully."
12
- end
13
- end
14
-
15
- end