whiteboard 0.0.1 → 0.0.2
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/README.md +2 -2
- data/bin/whiteboard +13 -0
- data/lib/whiteboard/cli.rb +51 -0
- data/lib/whiteboard/version.rb +1 -1
- data/whiteboard.gemspec +3 -3
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1655e5b40ebe88b8c67191006ad752667b45a820
|
4
|
+
data.tar.gz: 4b90d857b8fcc4bc29d29c5cec42af441fc1727a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64679f0a3d6434e164b6bde85394b8dec16cde6c4e43d9aefd69e973ed1444a166ca8a397b8dc12d0771bb89805997604a19d6c1674cf99198c5a57faf83e56c
|
7
|
+
data.tar.gz: f1f3eb1d7f2da3f144a7cf4e728b672a24b83b4df22c3bb6a88f483a09062d5d83d0f1051d7a1325deba3f72e388a7ecd3b42c331df0fbfa4c97ddea78f06779
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ It's simple.
|
|
12
12
|
|
13
13
|
Run `whiteboard new` to generate a sample `.whiteboard` file. Edit that file then run `whiteboard` to generate your app.
|
14
14
|
|
15
|
-
## Example
|
15
|
+
## Example Whiteboard file
|
16
16
|
|
17
17
|
```ruby
|
18
18
|
require "whiteboard"
|
@@ -58,7 +58,7 @@ end
|
|
58
58
|
|
59
59
|
## Contributing
|
60
60
|
|
61
|
-
1. Fork it ( https://github.com/
|
61
|
+
1. Fork it ( https://github.com/whiteboard-gem/whiteboard/fork )
|
62
62
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
63
63
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
64
64
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/bin/whiteboard
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'whiteboard'
|
4
|
+
require 'whiteboard/cli'
|
5
|
+
include Whiteboard::CLI
|
6
|
+
|
7
|
+
case ARGV[0]
|
8
|
+
when "new"
|
9
|
+
system "touch Whiteboard"
|
10
|
+
File.open('Whiteboard', 'w') { |file| file.write(file_string) }
|
11
|
+
when "run" || "generate" || "g"
|
12
|
+
system "ruby Whiteboard"
|
13
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
include Whiteboard
|
2
|
+
|
3
|
+
module Whiteboard
|
4
|
+
module CLI
|
5
|
+
|
6
|
+
def file_string
|
7
|
+
<<-eos
|
8
|
+
require "whiteboard"
|
9
|
+
include Whiteboard
|
10
|
+
|
11
|
+
Whiteboard.test_run! # Prints commands without actually running them
|
12
|
+
|
13
|
+
# Generate app
|
14
|
+
Whiteboard::App.new do |app|
|
15
|
+
app.name 'TestApp' # the only required field
|
16
|
+
# app.skip_bundle! # skip individual options
|
17
|
+
# app.skip! ['git', 'test-unit'] # skip multiple things
|
18
|
+
app.database 'postgresql' # defaults to sqlite, possible options are
|
19
|
+
# the rails defaults (not mongo, unfortunately)
|
20
|
+
app.ruby_version '2.1.2' # generates .ruby-version file
|
21
|
+
app.ruby_gemset 'testapp-gemset' # generates .ruby-gemset file
|
22
|
+
app.gems ['omniauth', 'omniauth-twitter'] # appends to Gemfile
|
23
|
+
app.gems ['twitter', ['rack', '>=1.0']] # appends gem with version specified
|
24
|
+
end
|
25
|
+
|
26
|
+
# Generate User model
|
27
|
+
Whiteboard::Model.new do |m|
|
28
|
+
m.name 'User'
|
29
|
+
m.field :name, :string
|
30
|
+
m.field :email, :string
|
31
|
+
m.field :password_digest, :string
|
32
|
+
end
|
33
|
+
|
34
|
+
# Generate Post Model
|
35
|
+
Whiteboard::Model.new do |m|
|
36
|
+
m.name 'Post'
|
37
|
+
m.field :title, :string
|
38
|
+
m.field :body, :text
|
39
|
+
m.field :user_id, :references, :index
|
40
|
+
end
|
41
|
+
|
42
|
+
# User controller
|
43
|
+
Whiteboard::Controller.new do |c|
|
44
|
+
c.name 'Users'
|
45
|
+
c.actions [:index, :new, :show]
|
46
|
+
end
|
47
|
+
eos
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
data/lib/whiteboard/version.rb
CHANGED
data/whiteboard.gemspec
CHANGED
@@ -6,14 +6,14 @@ require 'whiteboard/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "whiteboard"
|
8
8
|
spec.version = Whiteboard::VERSION
|
9
|
-
spec.authors = ["Nathan Bashaw"]
|
10
|
-
spec.email = ["nbashaw@gmail.com"]
|
9
|
+
spec.authors = ["Nathan Bashaw", "Lachlan Campbell"]
|
10
|
+
spec.email = ["nbashaw@gmail.com", "lachlan.campbell@icloud.com"]
|
11
11
|
spec.summary = %q{An intellectually satisfying way to start new rails apps.}
|
12
12
|
spec.homepage = "http://github.com/nbashaw/whiteboard"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
16
|
-
spec.executables =
|
16
|
+
spec.executables = ['whiteboard']
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whiteboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Bashaw
|
8
|
+
- Lachlan Campbell
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -41,7 +42,9 @@ dependencies:
|
|
41
42
|
description:
|
42
43
|
email:
|
43
44
|
- nbashaw@gmail.com
|
44
|
-
|
45
|
+
- lachlan.campbell@icloud.com
|
46
|
+
executables:
|
47
|
+
- whiteboard
|
45
48
|
extensions: []
|
46
49
|
extra_rdoc_files: []
|
47
50
|
files:
|
@@ -50,7 +53,9 @@ files:
|
|
50
53
|
- LICENSE.txt
|
51
54
|
- README.md
|
52
55
|
- Rakefile
|
56
|
+
- bin/whiteboard
|
53
57
|
- lib/whiteboard.rb
|
58
|
+
- lib/whiteboard/cli.rb
|
54
59
|
- lib/whiteboard/version.rb
|
55
60
|
- whiteboard.gemspec
|
56
61
|
homepage: http://github.com/nbashaw/whiteboard
|