anila 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +44 -0
- data/Rakefile +1 -0
- data/anila-cli.gemspec +24 -0
- data/bin/anila +4 -0
- data/lib/anila/cli/generator.rb +159 -0
- data/lib/anila/cli/version.rb +5 -0
- data/lib/anila/cli.rb +2 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cdd2f09d1062bd9daa04f5dc3d9ebbd53a2a0ead
|
4
|
+
data.tar.gz: e3442b9af11c87b2c7d3111c72a4264030e31039
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a60d97f38272c8fef94468d0fd297837def0927f7cb5dcbd5acc3ca674cce09ce8bedfaa6a40f323b1025dc06e403fccb526e7164645f3946af3d73e463fcc52
|
7
|
+
data.tar.gz: 5b828259ff04be4b7a345608aff8e1bba0194a7b89bc3d8d5f0dd83c68e643d218e8509997616a9b929b9d02619286b0c5beda5c357e98e989c60dbbcb92690b
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Bravocado
|
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,44 @@
|
|
1
|
+
# Anila::Cli
|
2
|
+
|
3
|
+
This is just a modification from [foundation-cli](https://github.com/mhayes/foundation-cli) because i can't write a ruby code but i just make my own workflow. Thanks to him.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'anila-cli'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install anila-cli
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
```bash
|
22
|
+
anila new my_awesome_project --version 1.0.0
|
23
|
+
```
|
24
|
+
|
25
|
+
### Update a project
|
26
|
+
```
|
27
|
+
cd ~/Sites/my_awesome_app
|
28
|
+
anila update --version 1.0.1
|
29
|
+
```
|
30
|
+
|
31
|
+
### Compile assets
|
32
|
+
|
33
|
+
```bash
|
34
|
+
cd ~/Sites/my_awesome_app
|
35
|
+
anila watch
|
36
|
+
```
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
1. Fork it
|
41
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
42
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
43
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
44
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/anila-cli.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'anila/cli/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "anila"
|
8
|
+
spec.version = Anila::CLI::VERSION
|
9
|
+
spec.authors = ["Bravocado"]
|
10
|
+
spec.email = ["bravocado.project@gmail.com"]
|
11
|
+
spec.description = %q{A CLI for working with Anila}
|
12
|
+
spec.summary = %q{Easy starting a project with Anila}
|
13
|
+
spec.homepage = "http://github.com/bravocado/anila-cli.git"
|
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
|
+
end
|
data/bin/anila
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
module Anila
|
5
|
+
module CLI
|
6
|
+
class Generator < Thor
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
no_commands do
|
10
|
+
def which(cmd)
|
11
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
12
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
13
|
+
exts.each { |ext|
|
14
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
15
|
+
return exe if File.executable? exe
|
16
|
+
}
|
17
|
+
end
|
18
|
+
return nil
|
19
|
+
end
|
20
|
+
|
21
|
+
def install_dependencies(deps=[])
|
22
|
+
if deps.include?("git") && !which("git")
|
23
|
+
say "Can't find git. You can install it by going here: http://git-scm.com/"
|
24
|
+
exit 1
|
25
|
+
end
|
26
|
+
|
27
|
+
if deps.include?("node") && !which("node")
|
28
|
+
say "Can't find NodeJS. You can install it by going here: http://nodejs.org"
|
29
|
+
exit 1
|
30
|
+
end
|
31
|
+
|
32
|
+
if deps.include?("bower") && !which("bower")
|
33
|
+
say "Can't find bower. You can install it by running: sudo npm install -g bower"
|
34
|
+
exit 1
|
35
|
+
end
|
36
|
+
|
37
|
+
if deps.include?("grunt") && !which("grunt")
|
38
|
+
say "Can't find grunt. You can install it by running: sudo npm install -g grunt-cli"
|
39
|
+
exit 1
|
40
|
+
end
|
41
|
+
|
42
|
+
if deps.include?("compass") && !which("compass")
|
43
|
+
# Auto install Compass as a convenience
|
44
|
+
run("gem install compass", capture: true, verbose: false)
|
45
|
+
run("rbenv rehash", capture: true, verbose: false) if which("rbenv")
|
46
|
+
unless which("compass")
|
47
|
+
say "Can't find compass. You can install it by running: gem install compass"
|
48
|
+
exit 1
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
desc "version", "Display CLI version"
|
55
|
+
def version
|
56
|
+
puts "v#{Anila::CLI::VERSION}"
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "upgrade", "Upgrade your Anila compass project"
|
60
|
+
def upgrade
|
61
|
+
install_dependencies(%w{git node bower compass})
|
62
|
+
|
63
|
+
if File.exists?(".bowerrc")
|
64
|
+
begin json = JSON.parse(File.read(".bowerrc"))
|
65
|
+
rescue JSON::ParserError
|
66
|
+
json = {}
|
67
|
+
end
|
68
|
+
unless json.has_key?("directory")
|
69
|
+
json["directory"] = "bower_components"
|
70
|
+
end
|
71
|
+
File.open(".bowerrc", "w") {|f| f.puts json.to_json}
|
72
|
+
else
|
73
|
+
create_file ".bowerrc" do
|
74
|
+
{:directory=>"bower_components"}.to_json
|
75
|
+
end
|
76
|
+
end
|
77
|
+
bower_directory = JSON.parse(File.read(".bowerrc"))["directory"]
|
78
|
+
|
79
|
+
gsub_file "config.rb", /require [\"\']anila[\"\']/ do |match|
|
80
|
+
match = "add_import_path \"#{bower_directory}/anila/scss\""
|
81
|
+
end
|
82
|
+
|
83
|
+
unless File.exists?("bower.json")
|
84
|
+
create_file "bower.json" do
|
85
|
+
{:name => "anila_project"}.to_json
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
run "bower install bravocado/bower-anila --save"
|
90
|
+
|
91
|
+
|
92
|
+
if defined?(Bundler)
|
93
|
+
Bundler.with_clean_env do
|
94
|
+
run("compass compile", capture: true, verbose: false)
|
95
|
+
end
|
96
|
+
else
|
97
|
+
run("compass compile", capture: true, verbose: false)
|
98
|
+
end
|
99
|
+
|
100
|
+
say <<-EOS
|
101
|
+
|
102
|
+
Anila has been setup in your project.
|
103
|
+
|
104
|
+
Please update references to javascript files to look something like:
|
105
|
+
|
106
|
+
<script src="#{bower_directory}/anila/js/anila.min.js"></script>
|
107
|
+
|
108
|
+
To update Anila in the future, just run: anila update
|
109
|
+
|
110
|
+
EOS
|
111
|
+
end
|
112
|
+
|
113
|
+
desc "new", "create new project"
|
114
|
+
option :libsass, type: :boolean, default: false
|
115
|
+
option :version, type: :string
|
116
|
+
def new(name)
|
117
|
+
if options[:libsass]
|
118
|
+
install_dependencies(%w{git node bower grunt})
|
119
|
+
repo = "https://github.com/bravocado/anila-libsass-template.git"
|
120
|
+
else
|
121
|
+
install_dependencies(%w{git node bower compass})
|
122
|
+
repo = "https://github.com/bravocado/anila-compass-template.git"
|
123
|
+
end
|
124
|
+
|
125
|
+
say "Creating ./#{name}"
|
126
|
+
empty_directory(name)
|
127
|
+
run("git clone #{repo} #{name}", capture: true, verbose: false)
|
128
|
+
inside(name) do
|
129
|
+
say "Installing dependencies with bower..."
|
130
|
+
run("bower install", capture: true, verbose: false)
|
131
|
+
File.open("scss/_settings.scss", "w") {|f| f.puts File.read("#{destination_root}/bower_components/anila/scss/anila/_settings.scss") }
|
132
|
+
run("git remote rm origin", capture: true, verbose: false)
|
133
|
+
if options[:libsass]
|
134
|
+
run "npm install"
|
135
|
+
run "grunt build"
|
136
|
+
else
|
137
|
+
if defined?(Bundler)
|
138
|
+
Bundler.with_clean_env do
|
139
|
+
run "compass compile"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
say "./#{name} was created"
|
146
|
+
end
|
147
|
+
|
148
|
+
desc "update", "update an existing project"
|
149
|
+
option :version, type: :string
|
150
|
+
def update
|
151
|
+
unless which("bower")
|
152
|
+
"Please install bower. Aborting."
|
153
|
+
exit 1
|
154
|
+
end
|
155
|
+
run "bower update"
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
data/lib/anila/cli.rb
ADDED
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: anila
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bravocado
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-25 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
|
+
description: A CLI for working with Anila
|
56
|
+
email:
|
57
|
+
- bravocado.project@gmail.com
|
58
|
+
executables:
|
59
|
+
- anila
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- .gitignore
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- anila-cli.gemspec
|
69
|
+
- bin/anila
|
70
|
+
- lib/anila/cli.rb
|
71
|
+
- lib/anila/cli/generator.rb
|
72
|
+
- lib/anila/cli/version.rb
|
73
|
+
homepage: http://github.com/bravocado/anila-cli.git
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.1.11
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Easy starting a project with Anila
|
97
|
+
test_files: []
|