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 +4 -4
- data/lib/crosstie/base.rb +2 -2
- data/lib/crosstie/templates/{sidekiq.rb → active_job.rb} +12 -12
- data/lib/crosstie/templates/add_gitignore.rb +0 -1
- data/lib/crosstie/templates/change_timezone.rb +6 -2
- data/lib/crosstie/templates/config_scaffold.rb +1 -1
- data/lib/crosstie/templates/skeleton.rb +17 -12
- data/lib/crosstie/templates/user.rb +17 -0
- data/lib/crosstie/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63d9caffe89a0d2e5bcf5aabd395c664e14a6afb
|
4
|
+
data.tar.gz: fecc0c37de9648a6c2ec08487056b00ac448d586
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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
|
-
#
|
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
|
-
|
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
|
-
|
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
|
@@ -1,3 +1,7 @@
|
|
1
1
|
# application.rb
|
2
|
-
# change timezone to
|
3
|
-
|
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
|
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
|
-
#
|
2
|
-
inject_into_file "app/
|
1
|
+
# application_controller.rb
|
2
|
+
inject_into_file "app/controllers/application_controller.rb", before: 'end' do
|
3
3
|
<<-EOF
|
4
4
|
|
5
|
-
#
|
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
|
-
#
|
19
|
-
inject_into_file "
|
14
|
+
# application.rb
|
15
|
+
inject_into_file "config/application.rb", after: "class Application < Rails::Application\n" do
|
20
16
|
<<-EOF
|
21
17
|
|
22
|
-
|
18
|
+
# timezone
|
23
19
|
|
24
|
-
|
20
|
+
# scaffold
|
25
21
|
|
26
|
-
|
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
|
data/lib/crosstie/version.rb
CHANGED
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.
|
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-
|
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
|