crosstie 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: addaa0436fa54b3742779c06948c4952c78ab72e
4
- data.tar.gz: 9acd54403092b0acf9ead18424674f6481dd887b
3
+ metadata.gz: 63d9caffe89a0d2e5bcf5aabd395c664e14a6afb
4
+ data.tar.gz: fecc0c37de9648a6c2ec08487056b00ac448d586
5
5
  SHA512:
6
- metadata.gz: 8ecc927ffcbc7d12e5aed9636e6c147e5e23dd132a96087834b71b4ddb29e925fb3cbea3d0d1c51335c4b4f473733349409b8c32b2908cf5c0e5e69c6a437887
7
- data.tar.gz: e18543b41fd576722618d8fd4a8902adb2ac2d71f15d3cace00959c50ed41e613a582a4c249ffccf03d94d1675886e1728ba69edcbce9ae117c240885e21cc59
6
+ metadata.gz: 0e98f7a87f055957b619e01d8294f1fca72c5d96c5bc90797ad4c4c4b767a8daa0c9c3fa057453f51002240be62c9893e00fc6ab86959e47cb632b9139ef875f
7
+ data.tar.gz: 3c624a3d4083b2d23ed41f5d67b8dbd36d91b463b174dee7613cac71d0f53a310358c1b1227b903e6dde872cfd6b2e6d62ec36d3ecadb3f3b8fe4953b18c2cd8
data/lib/crosstie/base.rb CHANGED
@@ -23,19 +23,19 @@ perform :install_gems
23
23
  perform :bundle_install
24
24
  perform :add_gitignore
25
25
  # perform :stop_robots # stop google
26
+ perform :skeleton
26
27
  perform :config_timezone
27
28
  perform :config_scaffold
28
29
  perform :serve_static
29
30
  perform :database_example
30
31
  perform :figaro
31
- perform :sidekiq
32
+ perform :active_job
32
33
  perform :simple_form
33
34
  perform :rails_layout
34
35
  perform :rspec
35
36
  perform :guard
36
37
  perform :static_pages
37
38
  perform :devise
38
- perform :skeleton
39
39
  perform :user
40
40
  # perform :ldap # who needs this
41
41
  perform :controller_helpers
@@ -1,19 +1,10 @@
1
- # sidekiq
1
+ # active_job
2
2
  append_file "config/application.yml", <<-EOF
3
3
  REDIS_HOST: localhost
4
4
  REDIS_PORT: "6379"
5
5
  EOF
6
6
  run "cp config/application.yml config/application.yml.example"
7
- create_file "app/workers/hello_worker.rb", <<-EOF
8
- class HelloWorker
9
- include Sidekiq::Worker
10
- sidekiq_options queue: :default
11
7
 
12
- def perform msg
13
- puts msg
14
- end
15
- end
16
- EOF
17
8
  create_file "config/initializers/sidekiq.rb", <<-EOF
18
9
  Sidekiq.configure_server do |config|
19
10
  config.redis = { :url => "redis://\#{ENV['REDIS_HOST']}:\#{ENV['REDIS_PORT']}/0", :namespace => '#{app_path}' }
@@ -23,6 +14,7 @@ Sidekiq.configure_client do |config|
23
14
  config.redis = { :url => "redis://\#{ENV['REDIS_HOST']}:\#{ENV['REDIS_PORT']}/0", :namespace => '#{app_path}' }
24
15
  end
25
16
  EOF
17
+
26
18
  create_file "tmp/pids/.keep", ""
27
19
  create_file "config/sidekiq.yml", <<-EOF
28
20
  ---
@@ -36,7 +28,8 @@ development:
36
28
  production:
37
29
  :concurrency: 2
38
30
  EOF
39
- inject_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do
31
+
32
+ inject_into_file "config/routes.rb", after: "# active_job\n" do
40
33
  <<-EOF
41
34
  require 'sidekiq/web'
42
35
  authenticate :user do
@@ -44,4 +37,11 @@ inject_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n"
44
37
  end
45
38
  EOF
46
39
  end
47
- run "cp config/sidekiq.yml config/sidekiq.yml.example"
40
+
41
+ inject_into_file "config/application.rb", after: "# active_job\n" do
42
+ <<-EOF
43
+ config.active_job.queue_name_prefix = Rails.env
44
+ config.active_job.queue_name_delimiter = '.'
45
+ # config.active_job.queue_adapter = :sidekiq
46
+ EOF
47
+ end
@@ -4,7 +4,6 @@ dump.rdb
4
4
  /config/database.yml
5
5
  /config/secrets.yml
6
6
  /config/ldap.yml
7
- /config/sidekiq.yml
8
7
  *.swp
9
8
  /coverage
10
9
  .DS_Store
@@ -1,3 +1,7 @@
1
1
  # application.rb
2
- # change timezone to beijing
3
- gsub_file "config/application.rb", "# config.time_zone = 'Central Time (US & Canada)'", "config.time_zone = 'Beijing'"
2
+ # change timezone to Beijing
3
+ inject_into_file 'config/application.rb', after: "# timezone\n" do
4
+ <<-EOF
5
+ "config.time_zone = 'Beijing'"
6
+ EOF
7
+ end
@@ -1,6 +1,6 @@
1
1
  # application.rb
2
2
  # stop scaffold from generating css, js, helper, test for helper, test for views
3
- inject_into_file "config/application.rb", after: "# config.i18n.default_locale = :de\n" do
3
+ inject_into_file 'config/application.rb', after: "# scaffold\n" do
4
4
  <<-EOS
5
5
  config.generators do |g|
6
6
  g.stylesheets false
@@ -1,12 +1,8 @@
1
- # user.rb
2
- inject_into_file "app/models/user.rb", before: 'end' do
1
+ # application_controller.rb
2
+ inject_into_file "app/controllers/application_controller.rb", before: 'end' do
3
3
  <<-EOF
4
4
 
5
- # crosstie skeleton
6
-
7
- # ldap
8
-
9
- # username
5
+ # controller_helpers
10
6
 
11
7
  # authentication_token
12
8
 
@@ -15,15 +11,24 @@ inject_into_file "app/models/user.rb", before: 'end' do
15
11
  EOF
16
12
  end
17
13
 
18
- # application_controller.rb
19
- inject_into_file "app/controllers/application_controller.rb", before: 'end' do
14
+ # application.rb
15
+ inject_into_file "config/application.rb", after: "class Application < Rails::Application\n" do
20
16
  <<-EOF
21
17
 
22
- # controller_helpers
18
+ # timezone
23
19
 
24
- # authentication_token
20
+ # scaffold
25
21
 
26
- # authorization
22
+ # active_job
23
+
24
+ EOF
25
+ end
26
+
27
+ # routes.rb
28
+ inject_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do
29
+ <<-EOF
30
+
31
+ # active_job
27
32
 
28
33
  EOF
29
34
  end
@@ -1,3 +1,20 @@
1
+ # user.rb
2
+ inject_into_file "app/models/user.rb", before: 'end' do
3
+ <<-EOF
4
+
5
+ # crosstie skeleton
6
+
7
+ # ldap
8
+
9
+ # username
10
+
11
+ # authentication_token
12
+
13
+ # authorization
14
+
15
+ EOF
16
+ end
17
+
1
18
  # add username to users
2
19
  inject_into_file "app/models/user.rb", after: "# username\n" do
3
20
  <<-EOF
@@ -1,3 +1,3 @@
1
1
  module Crosstie
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crosstie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dong Qingshan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,6 +70,7 @@ files:
70
70
  - lib/crosstie.rb
71
71
  - lib/crosstie/base.rb
72
72
  - lib/crosstie/cli.rb
73
+ - lib/crosstie/templates/active_job.rb
73
74
  - lib/crosstie/templates/add_gitignore.rb
74
75
  - lib/crosstie/templates/authentication_token.rb
75
76
  - lib/crosstie/templates/authorization.rb
@@ -99,7 +100,6 @@ files:
99
100
  - lib/crosstie/templates/run_test.rb
100
101
  - lib/crosstie/templates/seeds.rb
101
102
  - lib/crosstie/templates/serve_static.rb
102
- - lib/crosstie/templates/sidekiq.rb
103
103
  - lib/crosstie/templates/simple_form.rb
104
104
  - lib/crosstie/templates/skeleton.rb
105
105
  - lib/crosstie/templates/static_pages.rb