foundation-cli 0.0.1.alpha1 → 0.0.1.alpha2

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: 7646d7c2785cd4aae1015c8fffa89a039f7d744c
4
- data.tar.gz: 851256f88726a0ad65163a2513ae9b20703f895d
3
+ metadata.gz: e1c279f241d9c216d9490135c1b5b9cbc1a267d7
4
+ data.tar.gz: 456491f25d822a3fb6410c32bd1f5e7d34311560
5
5
  SHA512:
6
- metadata.gz: 434d927d571af27e63d5817bbb2c6648f1eaaa04e93d99e5d61bd5eee7f37f7cab43a407b594731162398e682c795ea8cd3b3bad15098b70919b5e8b492fe958
7
- data.tar.gz: 398f1b3b2e758e15b24691602d329f6736dc38a8488c57f178d07610908c4b7eb4efb82ff704073e97b79799cff95189a51097506407b0e233eeff33b43d30ca
6
+ metadata.gz: b08c3a3956d752cf14b0339b4da6d7d8ffaf81190798fecb2ff0a3cb7c7927b9760627390a11c26e1c43727397031c500eecae03e3b2ffb27ba735f9ee6d9967
7
+ data.tar.gz: 894369d6cd674d46706464a906cebd87efbaea3eee34a404b4a5851c3ae884ac0f09225df7bcd965b054c04e192b896c9cb6101b050d9fbd780f7f7e63896119
@@ -21,5 +21,4 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_dependency "thor", [">= 0.18.1"]
24
- spec.add_dependency "zurb-foundation", [">= 4.3.2"]
25
24
  end
@@ -1,13 +1,9 @@
1
1
  require "thor"
2
- require "zurb-foundation"
3
- require "bundler"
4
2
 
5
3
  module Foundation
6
4
  module CLI
7
5
  class Generator < Thor
8
6
  include Thor::Actions
9
- # source_root File.expand_path(File.join(File.dirname(__FILE__), "..", ".."))
10
- source_root Foundation.root
11
7
 
12
8
  no_commands do
13
9
  def which(cmd)
@@ -28,52 +24,65 @@ module Foundation
28
24
  end
29
25
 
30
26
  desc "new", "create new project"
31
- option :version, type: :string, default: Foundation::VERSION
27
+ option :libsass, type: :boolean, default: false
28
+ option :version, type: :string
32
29
  def new(name)
33
30
  # 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")
31
+ unless which("node") || which("npm")
32
+ say "Please install NodeJS. Aborting."
33
+ exit 1
37
34
  end
38
35
 
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
36
+ unless which("bower")
37
+ say "Please install bower. Aborting."
38
+ exit 1
39
+ end
40
+
41
+ unless which("grunt")
42
+ say "Please install grunt-cli. Aborting."
43
+ exit 1
44
+ end
45
+
46
+ unless which("git")
47
+ say "Please install git. Aborting."
48
+ exit 1
49
+ end
50
+
51
+
52
+ if options[:libsass]
53
+ repo = "git@github.com:zurb/foundation-libsass-template.git"
54
+ else
55
+ unless which("compass")
56
+ run("gem install compass", capture: true, verbose: false)
57
+ run("rbenv rehash", capture: true, verbose: false) if which("rbenv")
51
58
  end
59
+ repo = "git@github.com:zurb/foundation-compass-template.git"
60
+ end
52
61
 
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
62
+ say "Creating ./#{name}"
63
+ empty_directory(name)
64
+ run "git clone #{repo} #{name}", capture: true, verbose: false
65
+ inside(name) do
66
+ say "Installing dependencies with bower..."
67
+ run "bower install", capture: true, verbose: false
68
+ run "git remote rm origin", capture: true, verbose: false
69
+ if options[:libsass]
70
+ run "npm install"
71
+ run "grunt build"
56
72
  end
57
73
  end
58
74
 
59
- say "Foundation project has been created in ./#{name}"
75
+ say "./#{name} was created"
60
76
  end
61
77
 
62
78
  desc "update", "update an existing project"
63
- option :version, type: :string, default: Foundation::VERSION
79
+ option :version, type: :string
64
80
  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"
81
+ unless which("bower")
82
+ "Please install bower. Aborting."
83
+ exit 1
74
84
  end
75
- Process.wait(pid)
76
- exit $?.exitstatus
85
+ run "bower update"
77
86
  end
78
87
  end
79
88
  end
@@ -1,5 +1,5 @@
1
1
  module Foundation
2
2
  module CLI
3
- VERSION = "0.0.1.alpha1"
3
+ VERSION = "0.0.1.alpha2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foundation-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha1
4
+ version: 0.0.1.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Hayes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-07 00:00:00.000000000 Z
11
+ date: 2013-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
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
55
  description: A CLI for working with Foundation
70
56
  email:
71
57
  - mark@zurb.com