blacksmith-js 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.
- data/CHANGELOG +2 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +6 -0
- data/README.md +20 -0
- data/Rakefile +1 -1
- data/blacksmith.gemspec +2 -0
- data/lib/blacksmith/application.rb +14 -3
- data/lib/blacksmith/cli/init.rb +3 -0
- data/lib/blacksmith/configure.rb +2 -2
- data/lib/version.rb +1 -1
- metadata +35 -1
data/CHANGELOG
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -7,8 +7,13 @@ GEM
|
|
|
7
7
|
file-tail (1.0.12)
|
|
8
8
|
tins (~> 0.5)
|
|
9
9
|
gzip (1.0)
|
|
10
|
+
jshintrb (0.2.1)
|
|
11
|
+
execjs
|
|
12
|
+
multi_json (>= 1.3)
|
|
13
|
+
rake
|
|
10
14
|
listen (0.5.3)
|
|
11
15
|
multi_json (1.3.6)
|
|
16
|
+
rake (0.9.2.2)
|
|
12
17
|
rspec (2.11.0)
|
|
13
18
|
rspec-core (~> 2.11.0)
|
|
14
19
|
rspec-expectations (~> 2.11.0)
|
|
@@ -38,6 +43,7 @@ PLATFORMS
|
|
|
38
43
|
|
|
39
44
|
DEPENDENCIES
|
|
40
45
|
gzip
|
|
46
|
+
jshintrb
|
|
41
47
|
listen
|
|
42
48
|
rspec
|
|
43
49
|
sourcify
|
data/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### TODO ###
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
blacksmith is available as ruby gem.
|
|
9
|
+
|
|
10
|
+
$ gem install blacksmith-js
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
$ blacksmith init [project_name]
|
|
14
|
+
$ cd [project_name]
|
|
15
|
+
$ blacksmith build
|
|
16
|
+
|
|
17
|
+
## TODO
|
|
18
|
+
- blacksmith print version, --version
|
|
19
|
+
- file watcher
|
|
20
|
+
- static server
|
data/Rakefile
CHANGED
data/blacksmith.gemspec
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'uglifier'
|
|
2
|
-
|
|
2
|
+
require 'gzip'
|
|
3
|
+
require 'jshintrb'
|
|
3
4
|
|
|
4
5
|
module Blacksmith
|
|
5
6
|
class Application
|
|
@@ -15,15 +16,25 @@ module Blacksmith
|
|
|
15
16
|
files.each do |f|
|
|
16
17
|
output = Preprocessor.proccess(f)
|
|
17
18
|
|
|
19
|
+
if Blacksmith.config.jshint
|
|
20
|
+
puts Jshintrb.report(["#{Blacksmith.config.source_folder}/#{f}.js"]) #need pullrequest Jshintrb
|
|
21
|
+
end
|
|
22
|
+
|
|
18
23
|
if Blacksmith.config.env == :production
|
|
19
24
|
output = Uglifier.compile(output)
|
|
20
25
|
end
|
|
21
26
|
|
|
22
27
|
output_file = File.new(output_filename_helper(f), 'w')
|
|
23
28
|
output_file.write(output)
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if Blacksmith.config.gzip
|
|
32
|
+
output_file_gzip = File.new(output_filename_helper(f, :gzip => true), 'w')
|
|
33
|
+
output_file_gzip.write(output.gzip)
|
|
34
|
+
end
|
|
26
35
|
end
|
|
36
|
+
|
|
37
|
+
puts 'Build successfully.'
|
|
27
38
|
end
|
|
28
39
|
|
|
29
40
|
|
data/lib/blacksmith/cli/init.rb
CHANGED
|
@@ -5,6 +5,9 @@ class Blacksmith::Cli
|
|
|
5
5
|
def init(project_name)
|
|
6
6
|
create_file "#{project_name}/config.rb" do
|
|
7
7
|
"set :build_files, ['#{project_name}']"
|
|
8
|
+
"set :jshint, false # in development "
|
|
9
|
+
"set :gzip, true"
|
|
10
|
+
"set :compile, false"
|
|
8
11
|
end
|
|
9
12
|
create_file "#{project_name}/source/#{project_name}.js"
|
|
10
13
|
create_file "#{project_name}/build/.gitkeep"
|
data/lib/blacksmith/configure.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Blacksmith
|
|
2
2
|
class Configure
|
|
3
|
-
attr_accessor :build_files
|
|
3
|
+
attr_accessor :build_files, :jshint, :gzip, :compile
|
|
4
4
|
|
|
5
5
|
def initialize
|
|
6
6
|
exec_config_file
|
|
@@ -11,7 +11,7 @@ module Blacksmith
|
|
|
11
11
|
instance_variable_set(:"@#{k}", v)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def exec_config_file
|
|
14
|
+
def exec_config_file
|
|
15
15
|
instance_eval(File.read(File.join(Dir.pwd, 'config.rb')))
|
|
16
16
|
end
|
|
17
17
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: blacksmith-js
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -43,6 +43,38 @@ dependencies:
|
|
|
43
43
|
- - ~>
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: 1.3.0
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: gzip
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
50
|
+
requirements:
|
|
51
|
+
- - ! '>='
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
type: :runtime
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ! '>='
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
63
|
+
name: jshintrb
|
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
|
65
|
+
none: false
|
|
66
|
+
requirements:
|
|
67
|
+
- - ! '>='
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0'
|
|
70
|
+
type: :runtime
|
|
71
|
+
prerelease: false
|
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ! '>='
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0'
|
|
46
78
|
description: build js library, extensions with blacksmith
|
|
47
79
|
email: varlamoved@gmail.com
|
|
48
80
|
executables:
|
|
@@ -53,8 +85,10 @@ files:
|
|
|
53
85
|
- .gitignore
|
|
54
86
|
- .rspec
|
|
55
87
|
- .rvmrc
|
|
88
|
+
- CHANGELOG
|
|
56
89
|
- Gemfile
|
|
57
90
|
- Gemfile.lock
|
|
91
|
+
- README.md
|
|
58
92
|
- Rakefile
|
|
59
93
|
- bin/blacksmith
|
|
60
94
|
- blacksmith.gemspec
|