foundation-cli 0.0.1.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +42 -0
- data/Rakefile +1 -0
- data/bin/foundation +4 -0
- data/foundation-cli.gemspec +25 -0
- data/lib/foundation/cli.rb +2 -0
- data/lib/foundation/cli/generator.rb +80 -0
- data/lib/foundation/cli/version.rb +5 -0
- data/test/Gemfile +3 -0
- metadata +113 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7646d7c2785cd4aae1015c8fffa89a039f7d744c
|
4
|
+
data.tar.gz: 851256f88726a0ad65163a2513ae9b20703f895d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 434d927d571af27e63d5817bbb2c6648f1eaaa04e93d99e5d61bd5eee7f37f7cab43a407b594731162398e682c795ea8cd3b3bad15098b70919b5e8b492fe958
|
7
|
+
data.tar.gz: 398f1b3b2e758e15b24691602d329f6736dc38a8488c57f178d07610908c4b7eb4efb82ff704073e97b79799cff95189a51097506407b0e233eeff33b43d30ca
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Mark Hayes
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Foundation::Cli
|
2
|
+
|
3
|
+
**NOTE:** This is considered alpha, things may change without notice.
|
4
|
+
|
5
|
+
A CLI for creating and updating Foundation projects.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
```bash
|
10
|
+
git clone git@github.com:mhayes/foundation-cli.git
|
11
|
+
bundle install
|
12
|
+
bundle exec rake install
|
13
|
+
```
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
### Create a new project
|
18
|
+
|
19
|
+
```bash
|
20
|
+
foundation new my_awesome_project --version 4.3.2
|
21
|
+
```
|
22
|
+
|
23
|
+
### Update a project
|
24
|
+
```
|
25
|
+
cd ~/Sites/my_awesome_app
|
26
|
+
foundation update --version 4.3.2
|
27
|
+
```
|
28
|
+
|
29
|
+
### Compile assets
|
30
|
+
|
31
|
+
```bash
|
32
|
+
cd ~/Sites/my_awesome_app
|
33
|
+
foundation watch
|
34
|
+
```
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
1. Fork it
|
39
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
40
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
41
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
42
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/foundation
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'foundation/cli/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "foundation-cli"
|
8
|
+
spec.version = Foundation::CLI::VERSION
|
9
|
+
spec.authors = ["Mark Hayes"]
|
10
|
+
spec.email = ["mark@zurb.com"]
|
11
|
+
spec.description = %q{A CLI for working with Foundation}
|
12
|
+
spec.summary = %q{The easiest way to get started with Foundation}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_dependency "thor", [">= 0.18.1"]
|
24
|
+
spec.add_dependency "zurb-foundation", [">= 4.3.2"]
|
25
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "zurb-foundation"
|
3
|
+
require "bundler"
|
4
|
+
|
5
|
+
module Foundation
|
6
|
+
module CLI
|
7
|
+
class Generator < Thor
|
8
|
+
include Thor::Actions
|
9
|
+
# source_root File.expand_path(File.join(File.dirname(__FILE__), "..", ".."))
|
10
|
+
source_root Foundation.root
|
11
|
+
|
12
|
+
no_commands do
|
13
|
+
def which(cmd)
|
14
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
15
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
16
|
+
exts.each { |ext|
|
17
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
18
|
+
return exe if File.executable? exe
|
19
|
+
}
|
20
|
+
end
|
21
|
+
return nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "version", "Display CLI version"
|
26
|
+
def version
|
27
|
+
puts "v#{Foundation::CLI::VERSION}"
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "new", "create new project"
|
31
|
+
option :version, type: :string, default: Foundation::VERSION
|
32
|
+
def new(name)
|
33
|
+
# RUBY_VERSION == "2.0.0"
|
34
|
+
unless which("bundle")
|
35
|
+
run("gem install bundler", capture: true, verbose: false)
|
36
|
+
run("rbenv rehash", capture: true, verbose: false) if which("rbenv")
|
37
|
+
end
|
38
|
+
|
39
|
+
empty_directory(name)
|
40
|
+
inside(name) do
|
41
|
+
if File.exists?("Gemfile")
|
42
|
+
gsub_file("Gemfile", /gem ['"]zurb-foundation['"].*/, "gem \"zurb-foundation\", \"~> #{options[:version]}\"")
|
43
|
+
else
|
44
|
+
create_file("Gemfile") do
|
45
|
+
s=<<-EOS
|
46
|
+
source "https://rubygems.org"
|
47
|
+
gem "compass"
|
48
|
+
gem "zurb-foundation", "#{options[:version]}"
|
49
|
+
EOS
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
Bundler.with_clean_env do
|
54
|
+
run "bundle install", :capture => true, :verbose => false
|
55
|
+
run "bundle exec compass create . -r zurb-foundation --using foundation", :capture => true, :verbose => false
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
say "Foundation project has been created in ./#{name}"
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "update", "update an existing project"
|
63
|
+
option :version, type: :string, default: Foundation::VERSION
|
64
|
+
def update
|
65
|
+
directory("js/foundation", "javascripts/foundation")
|
66
|
+
remove_file("javascripts/foundation/index.js")
|
67
|
+
# copy_file("templates/index.html", "index.html")
|
68
|
+
end
|
69
|
+
|
70
|
+
desc "watch", "compile assets"
|
71
|
+
def watch
|
72
|
+
pid = fork do
|
73
|
+
run "bundle exec compass watch"
|
74
|
+
end
|
75
|
+
Process.wait(pid)
|
76
|
+
exit $?.exitstatus
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/test/Gemfile
ADDED
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: foundation-cli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.alpha1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mark Hayes
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: thor
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.18.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.18.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: zurb-foundation
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 4.3.2
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 4.3.2
|
69
|
+
description: A CLI for working with Foundation
|
70
|
+
email:
|
71
|
+
- mark@zurb.com
|
72
|
+
executables:
|
73
|
+
- foundation
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/foundation
|
83
|
+
- foundation-cli.gemspec
|
84
|
+
- lib/foundation/cli.rb
|
85
|
+
- lib/foundation/cli/generator.rb
|
86
|
+
- lib/foundation/cli/version.rb
|
87
|
+
- test/Gemfile
|
88
|
+
homepage: ''
|
89
|
+
licenses:
|
90
|
+
- MIT
|
91
|
+
metadata: {}
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - '>'
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.3.1
|
106
|
+
requirements: []
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 2.0.3
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: The easiest way to get started with Foundation
|
112
|
+
test_files:
|
113
|
+
- test/Gemfile
|