daiku 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -19
- data/lib/daiku/_app/.node-version.tt +1 -0
- data/lib/daiku/_app/.slugignore +1 -1
- data/lib/daiku/_app/Gemfile.tt +4 -0
- data/lib/daiku/_app/config.ru.tt +1 -2
- data/lib/daiku/_app/public/favicon.ico +0 -0
- data/lib/daiku/_app/spec/spec_helper.rb +2 -3
- data/lib/daiku/_app/views/layout.slim +0 -3
- data/lib/daiku/cli.rb +2 -1
- data/lib/daiku/plugins/database-sql/cli.rb +8 -4
- data/lib/daiku/plugins/grunt/_config/sass.coffee +2 -2
- data/lib/daiku/plugins/grunt/_config/uglify.coffee +2 -2
- data/lib/daiku/plugins/grunt/_templates/{Gruntfile.coffee → Gruntfile.coffee.tt} +0 -0
- data/lib/daiku/plugins/grunt/_templates/bower.json.tt +1 -1
- data/lib/daiku/plugins/grunt/_templates/package.json.tt +10 -9
- data/lib/daiku/plugins/grunt/cli.rb +6 -0
- data/lib/daiku/plugins/sidekiq/cli.rb +7 -2
- data/lib/daiku/version.rb +1 -1
- metadata +5 -4
- data/lib/daiku/_app/.node-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dd1097cb00c2e89d1d4ac2ef0c7d7507951d849
|
4
|
+
data.tar.gz: 65357c4faee3832c917bd05291e95df1c8a731dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb8d0624c0f23c8c6ea9b17d1bba949bbefb54092d2f585f68056fbdd3953bc337f99990459abcb8dddce675e91e35fac90a10c2291763b81f3dc06db36a5fb6
|
7
|
+
data.tar.gz: b77e23dd95b9444e40358f34d8065405ccb9a162707efb30ae5685e968424738637e868d2d744505be98875adb88eea6c7bf40cf894d75466499f4035e4dfbcd
|
data/README.md
CHANGED
@@ -23,6 +23,13 @@ To generate a basic app, run the `new` command, passing it the port your local s
|
|
23
23
|
$ bundle exec foreman start
|
24
24
|
$ open http://localhost:5000
|
25
25
|
|
26
|
+
|
27
|
+
Or as a oneliner:
|
28
|
+
|
29
|
+
daiku new myapp --port 5000 && cd myapp && bundle install && bundle exec foreman start
|
30
|
+
|
31
|
+
Then visit `http://localhost:5000` in your browser.
|
32
|
+
|
26
33
|
### Options
|
27
34
|
|
28
35
|
You can further customize the app that's generated by passing additional options. The built-in help system explains the available options.
|
@@ -32,29 +39,33 @@ You can further customize the app that's generated by passing additional options
|
|
32
39
|
daiku new APP -p, --port=N
|
33
40
|
|
34
41
|
Options:
|
35
|
-
-p, --port=N
|
36
|
-
[--ruby
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
-p, --port=N # Port this app should run on locally.
|
43
|
+
[--ruby=RUBY] # Specify the version of ruby this project should use.
|
44
|
+
# Default: 2.1.5
|
45
|
+
[--node=NODE] # Specify the version of node this project should use (for grunt, etc).
|
46
|
+
# Default: v0.10.33
|
47
|
+
-a, [--assets=ASSETS] # Choose the assets workflow this project uses.
|
48
|
+
# Possible values: grunt
|
49
|
+
-e, [--errors=ERRORS] # Choose the error reporting lib this project uses.
|
50
|
+
# Possible values: honeybadger
|
51
|
+
-j, [--jobs=JOBS] # Choose the background jobs lib this project uses.
|
52
|
+
# Possible values: sidekiq
|
53
|
+
-m, [--models=MODELS] # Choose the data modeling lib this project uses.
|
54
|
+
# Possible values: datamapper
|
55
|
+
-M, [--monitors=MONITORS] # Choose the monitoring lib this project uses.
|
56
|
+
# Possible values: newrelic
|
57
|
+
[--vcr] # Include `vcr` in this project's BDD stack?
|
58
|
+
[--sql] # SQL or No-SQL? If SQL, assumes postgresql
|
59
|
+
# Default: true
|
60
|
+
[--version]
|
61
|
+
|
62
|
+
Generate a new application with daiku
|
52
63
|
|
53
64
|
### Example
|
54
65
|
|
55
66
|
Consider the following example:
|
56
67
|
|
57
|
-
$ daiku new myapp
|
68
|
+
$ daiku new myapp --port 5000 --models datamapper --assets grunt --errors honeybadger --monitors newrelic --jobs sidekiq --vcr
|
58
69
|
|
59
70
|
This will generate the following app:
|
60
71
|
|
@@ -95,7 +106,7 @@ myapp
|
|
95
106
|
├── bower.json
|
96
107
|
├── config
|
97
108
|
│ ├── datamapper.rb
|
98
|
-
│ ├──
|
109
|
+
│ ├── pony.rb
|
99
110
|
│ ├── puma.rb
|
100
111
|
│ └── sidekiq.rb
|
101
112
|
├── config.ru
|
@@ -120,6 +131,7 @@ myapp
|
|
120
131
|
├── public
|
121
132
|
│ ├── assets
|
122
133
|
│ │ └── .gitkeep
|
134
|
+
│ ├── favicon.ico
|
123
135
|
│ └── fonts
|
124
136
|
│ └── .gitkeep
|
125
137
|
├── spec
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= @node -%>
|
data/lib/daiku/_app/.slugignore
CHANGED
data/lib/daiku/_app/Gemfile.tt
CHANGED
data/lib/daiku/_app/config.ru.tt
CHANGED
Binary file
|
@@ -1,12 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
ENV['RACK_ENV'] = 'test'
|
3
3
|
dbuser = (ENV['TRAVIS']) ? 'postgres@' : nil
|
4
|
-
ENV['
|
4
|
+
ENV['DB_NAME_TEST'] = "#{ENV['DB_NAME']}_test"
|
5
|
+
ENV['DATABASE_URL'] = "postgres://#{dbuser}localhost/#{ENV['DB_NAME_TEST']}"
|
5
6
|
lib_path = File.expand_path('../../lib', __FILE__)
|
6
7
|
($:.unshift lib_path) unless ($:.include? lib_path)
|
7
8
|
require 'boot'
|
8
9
|
Bundler.setup(:test)
|
9
|
-
DatabaseCleaner.strategy = :truncation
|
10
|
-
require 'sidekiq/testing'
|
11
10
|
require 'minitest/autorun'
|
12
11
|
MiniTest::Reporters.use! MiniTest::Reporters::SpecReporter.new
|
@@ -16,8 +16,5 @@ html
|
|
16
16
|
meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"
|
17
17
|
meta name="HandheldFriendly" content="True"
|
18
18
|
meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"
|
19
|
-
link rel="stylesheet" type="text/css" href="/assets/app.css"
|
20
|
-
script src="/assets/html5shiv.js"
|
21
19
|
body
|
22
20
|
== yield
|
23
|
-
script src="/assets/app.js"
|
data/lib/daiku/cli.rb
CHANGED
@@ -14,7 +14,7 @@ module Daiku
|
|
14
14
|
desc "new APP", "Generate a new application with daiku"
|
15
15
|
method_option :port, required: true, aliases: '-p', type: :numeric, desc: 'Port this app should run on locally.'
|
16
16
|
method_option :ruby, default: '2.1.5', desc: 'Specify the version of ruby this project should use.'
|
17
|
-
method_option :node, default: 'v0.10.33', desc: 'Specify the version of node this project should use.'
|
17
|
+
method_option :node, default: 'v0.10.33', desc: 'Specify the version of node this project should use (for grunt, etc).'
|
18
18
|
method_option :assets, aliases: '-a', desc: 'Choose the assets workflow this project uses.', enum: Daiku::Plugins.plugin_names('assets')
|
19
19
|
method_option :errors, aliases: '-e', desc: 'Choose the error reporting lib this project uses.', enum: Daiku::Plugins.plugin_names('errors')
|
20
20
|
method_option :jobs, aliases: '-j', desc: 'Choose the background jobs lib this project uses.', enum: Daiku::Plugins.plugin_names('jobs')
|
@@ -26,6 +26,7 @@ module Daiku
|
|
26
26
|
@app = app
|
27
27
|
@port = options[:port]
|
28
28
|
@ruby = options[:ruby]
|
29
|
+
@node = options[:node]
|
29
30
|
@models = options[:models]
|
30
31
|
@assets = options[:assets]
|
31
32
|
@jobs = options[:jobs]
|
@@ -16,10 +16,10 @@ module Daiku
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def dotenv
|
19
|
-
dbname
|
20
|
-
dburl
|
21
|
-
append_to_file "#{app}/.env", "DATABASE_NAME=#{dbname}"
|
22
|
-
append_to_file "#{app}/.env", "DATABASE_URL=#{dburl}"
|
19
|
+
dbname = options.fetch(:'db-url') { app }
|
20
|
+
dburl = options.fetch(:'db-name') { "postgres://localhost/#{app}" }
|
21
|
+
append_to_file "#{app}/.env", "DATABASE_NAME=#{dbname}\n"
|
22
|
+
append_to_file "#{app}/.env", "DATABASE_URL=#{dburl}\n"
|
23
23
|
end
|
24
24
|
|
25
25
|
def config
|
@@ -30,6 +30,10 @@ module Daiku
|
|
30
30
|
insert_into_file "#{app}/Gemfile", " gem 'database_cleaner'\n", after: "group :test do\n"
|
31
31
|
end
|
32
32
|
|
33
|
+
def spechelper
|
34
|
+
insert_into_file "#{app}/spec/spec_helper.rb", "DatabaseCleaner.strategy = :truncation\n", after: "Bundler.setup(:test)\n"
|
35
|
+
end
|
36
|
+
|
33
37
|
def travisyml
|
34
38
|
insert_into_file "#{app}/.travis.yml", " - postgresql\n", after: "services:\n"
|
35
39
|
insert_into_file "#{app}/.travis.yml", " postgresql: 9.3\n", after: "addons:\n"
|
File without changes
|
@@ -3,16 +3,17 @@
|
|
3
3
|
"version": "0.0.1",
|
4
4
|
"private": true,
|
5
5
|
"dependencies": {
|
6
|
-
"grunt": "~0.
|
7
|
-
"grunt
|
8
|
-
"grunt-contrib-
|
9
|
-
"grunt-contrib-
|
10
|
-
"grunt-contrib-
|
11
|
-
"grunt-
|
6
|
+
"grunt-cli": "~0.1.13",
|
7
|
+
"grunt": "~0.4.5",
|
8
|
+
"grunt-contrib-coffee": "~0.12.0",
|
9
|
+
"grunt-contrib-imagemin": "~0.9.2",
|
10
|
+
"grunt-contrib-sass": "~0.8.1",
|
11
|
+
"grunt-contrib-uglify": "~0.6.0",
|
12
|
+
"grunt-newer": "~0.8.0",
|
12
13
|
"grunt-robots-txt": "~0.3.0",
|
13
14
|
"grunt-slim": "^0.1.0",
|
14
|
-
"load-grunt-config": "~0.
|
15
|
-
"load-grunt-tasks": "~0.
|
16
|
-
"time-grunt": "~0.
|
15
|
+
"load-grunt-config": "~0.16.0",
|
16
|
+
"load-grunt-tasks": "~1.0.0",
|
17
|
+
"time-grunt": "~1.0.0"
|
17
18
|
}
|
18
19
|
}
|
@@ -20,6 +20,12 @@ module Daiku
|
|
20
20
|
template '_templates/package.json.tt', "#{app}/package.json"
|
21
21
|
directory '_config', "#{app}/.grunt"
|
22
22
|
end
|
23
|
+
|
24
|
+
def layout
|
25
|
+
insert_into_file "#{app}/views/layout.slim", %Q( link rel="stylesheet" type="text/css" href="/assets/app.css"\n), before: " body\n"
|
26
|
+
insert_into_file "#{app}/views/layout.slim", %Q( script src="/assets/html5shiv.js"\n), before: " body\n"
|
27
|
+
insert_into_file "#{app}/views/layout.slim", %Q( script src="/assets/app.js"\n), after: " == yield\n"
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
25
31
|
end
|
@@ -41,12 +41,17 @@ module Daiku
|
|
41
41
|
require 'sidekiq/web'
|
42
42
|
map '/sidekiq' do
|
43
43
|
Sidekiq::Web.use Rack::Auth::Basic do |username, password|
|
44
|
-
|
44
|
+
username == ENV['SIDEKIQ_USERNAME'] && password == ENV['SIDEKIQ_PASSWORD']
|
45
|
+
end
|
46
|
+
run Sidekiq::Web\n
|
45
47
|
end
|
46
|
-
run Sidekiq::Web
|
47
48
|
SKMW
|
48
49
|
append_to_file "#{app}/config.ru", content
|
49
50
|
end
|
51
|
+
|
52
|
+
def spechelper
|
53
|
+
insert_into_file "#{app}/spec/spec_helper.rb", "require 'sidekiq/testing'\n", before: "require 'minitest/autorun'\n"
|
54
|
+
end
|
50
55
|
end
|
51
56
|
end
|
52
57
|
end
|
data/lib/daiku/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daiku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Marden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -70,7 +70,7 @@ files:
|
|
70
70
|
- lib/daiku.rb
|
71
71
|
- lib/daiku/_app/.env.tt
|
72
72
|
- lib/daiku/_app/.gitignore
|
73
|
-
- lib/daiku/_app/.node-version
|
73
|
+
- lib/daiku/_app/.node-version.tt
|
74
74
|
- lib/daiku/_app/.ruby-version.tt
|
75
75
|
- lib/daiku/_app/.slugignore
|
76
76
|
- lib/daiku/_app/.travis.yml.tt
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/daiku/_app/lib/tasks/.gitkeep
|
97
97
|
- lib/daiku/_app/lib/values/.gitkeep
|
98
98
|
- lib/daiku/_app/public/assets/.gitkeep
|
99
|
+
- lib/daiku/_app/public/favicon.ico
|
99
100
|
- lib/daiku/_app/public/fonts/.gitkeep
|
100
101
|
- lib/daiku/_app/spec/app_spec.rb
|
101
102
|
- lib/daiku/_app/spec/models/.gitkeep
|
@@ -123,7 +124,7 @@ files:
|
|
123
124
|
- lib/daiku/plugins/grunt/_config/uglify.coffee
|
124
125
|
- lib/daiku/plugins/grunt/_templates/.bowerrc
|
125
126
|
- lib/daiku/plugins/grunt/_templates/.bowerrc.tt
|
126
|
-
- lib/daiku/plugins/grunt/_templates/Gruntfile.coffee
|
127
|
+
- lib/daiku/plugins/grunt/_templates/Gruntfile.coffee.tt
|
127
128
|
- lib/daiku/plugins/grunt/_templates/bower.json.tt
|
128
129
|
- lib/daiku/plugins/grunt/_templates/package.json.tt
|
129
130
|
- lib/daiku/plugins/grunt/cli.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= @node %>
|