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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e8b05bc97a7765ef02bad3f80967d180967e14d
4
- data.tar.gz: 286c391924557281a930f595163eb5d9239f8e39
3
+ metadata.gz: 5dd1097cb00c2e89d1d4ac2ef0c7d7507951d849
4
+ data.tar.gz: 65357c4faee3832c917bd05291e95df1c8a731dd
5
5
  SHA512:
6
- metadata.gz: eb28349484e0b914c839bef30de734bd368f0b63696f26d0cb616e90d0a3e4872f13d727bd215c47fafd527c9397fd3406af74131ca8a9d0cb7b7e4efb8ef90e
7
- data.tar.gz: cc7715bd90bceb56eba923207c281b54b7069b68a8bfe9b5442bd0de362b3d28001a9f91639e661ea5ad87ee699f30a1c406813acac87923700cd05beaf6fba9
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 # Port this app should run on locally.
36
- [--ruby-version=RUBY_VERSION] # Specify the version of ruby this project should use.
37
- # Default: 2.1.2
38
- -m, [--models=MODELS] # Choose the data modeling tool this project uses.
39
- # Default: datamapper
40
- # Possible values: datamapper, none
41
- -a, [--assets=ASSETS] # Choose the assets workflow this project uses.
42
- # Default: grunt
43
- # Possible values: grunt, none
44
- [--honeybadger-private-key=HONEYBADGER-PRIVATE-KEY] # Honeybadger Private API Key
45
- [--honeybadger-public-key=HONEYBADGER-PUBLIC-KEY] # Honeybadger Private API Key
46
- [--no-newrelic] # Don't use New Relic.
47
- [--with-vcr] # Include `vcr` in this project's TDD stack.
48
- [--with-sidekiq] # Set this project up to use `sidekiq` for background processing.
49
-
50
- Generate a new application with daiku
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 -p 5000 -m datamapper -a grunt --with-vcr --with-sidekiq
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
- │   ├── honeybadger.rb
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 -%>
@@ -1,5 +1,5 @@
1
1
  .env
2
- .ssl
3
2
  .certs
4
3
  .ssl
5
4
  ./assets
5
+ ./spec
@@ -36,3 +36,7 @@ group :development, :test do
36
36
  gem 'foreman', require: false
37
37
  gem 'dotenv'
38
38
  end
39
+
40
+ group :assets do
41
+ gem 'sass'
42
+ end
@@ -21,5 +21,4 @@ use Rack::Deflater
21
21
  use Rack::Runtime
22
22
 
23
23
  # make the jump
24
- run app
25
-
24
+ run App
@@ -1,12 +1,11 @@
1
1
  # encoding: utf-8
2
2
  ENV['RACK_ENV'] = 'test'
3
3
  dbuser = (ENV['TRAVIS']) ? 'postgres@' : nil
4
- ENV['DATABASE_URL'] = "postgres://#{dbuser}localhost/#{ENV['DB_NAME']}"
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"
@@ -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 = options.fetch(:'db-name') { "postgres://localhost/#{app}" }
20
- dburl = options.fetch(:'db-url') { app }
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"
@@ -1,7 +1,7 @@
1
1
  module.exports =
2
2
  default:
3
- files: 'public/assets/main.css': [
4
- 'assets/stylesheets/main.scss'
3
+ files: 'public/assets/app.css': [
4
+ 'assets/stylesheets/app.scss'
5
5
  ]
6
6
  options:
7
7
  style: 'expanded'
@@ -8,8 +8,8 @@ module.exports =
8
8
  'assets/vendor/jquery/dist/jquery.js'
9
9
  'assets/vendor/underscore/underscore.js'
10
10
  ]
11
- 'public/assets/main.js': [
12
- 'public/assets/main.js'
11
+ 'public/assets/app.js': [
12
+ 'public/assets/app.js'
13
13
  ]
14
14
  options:
15
15
  beautify: true
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jquery": "~2.1.0",
5
5
  "underscore": "~1.7.0",
6
- "html5shiv": "~3.7.2",
6
+ "html5shiv": "~3.7.2"
7
7
  }
8
8
  }
@@ -3,16 +3,17 @@
3
3
  "version": "0.0.1",
4
4
  "private": true,
5
5
  "dependencies": {
6
- "grunt": "~0.4.2",
7
- "grunt-contrib-coffee": "~0.10.1",
8
- "grunt-contrib-imagemin": "~0.4.0",
9
- "grunt-contrib-sass": "~0.7.2",
10
- "grunt-contrib-uglify": "~0.3.2",
11
- "grunt-newer": "~0.6.1",
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.7.1",
15
- "load-grunt-tasks": "~0.3.0",
16
- "time-grunt": "~0.2.9"
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
- username == ENV['SIDEKIQ_USERNAME'] && password == ENV['SIDEKIQ_PASSWORD']
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
@@ -1,3 +1,3 @@
1
1
  module Daiku
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-10 00:00:00.000000000 Z
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 %>