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.
@@ -0,0 +1,2 @@
1
+
2
+ 0.0.2 - add jshint before build 17.10.12
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gem 'listen'
6
6
 
7
7
  gem 'uglifier'
8
8
  gem 'gzip'
9
+ gem 'jshintrb'
9
10
 
10
11
  group :test do
11
12
  gem 'rspec'
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
 
2
2
  task :install do
3
3
  `gem build blacksmith.gemspec`
4
- `gem install blacksmith-0.0.1.gem`
4
+ `gem install blacksmith-js-0.0.2.gem`
5
5
  end
@@ -12,5 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.executables << 'blacksmith'
13
13
  s.add_dependency("listen", ["~> 0.5.3"])
14
14
  s.add_dependency("uglifier", ["~> 1.3.0"])
15
+ s.add_dependency("gzip")
16
+ s.add_dependency("jshintrb")
15
17
  end
16
18
 
@@ -1,5 +1,6 @@
1
1
  require 'uglifier'
2
- #require 'gzip'
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
- #output_file_gzip = File.new(output_filename_helper(file, :gzip => true), 'w')
25
- #output_file_gzip.write(output.gzip)
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
 
@@ -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"
@@ -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(&block)
14
+ def exec_config_file
15
15
  instance_eval(File.read(File.join(Dir.pwd, 'config.rb')))
16
16
  end
17
17
 
@@ -1,3 +1,3 @@
1
1
  module Blacksmith
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
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.1
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