jumbler 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +189 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/TODO.md +7 -0
- data/bin/jumbler +1 -1
- data/jumbler.gemspec +34 -0
- data/lib/jumbler.rb +19 -11
- data/lib/jumbler/version.rb +3 -0
- data/{README.md → readme.md} +1 -1
- metadata +58 -5
- data/lib/subfolder/Copy (2) of sad.js +0 -4
- data/lib/subfolder/sad.js +0 -6
data/.gitignore
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
#################
|
2
|
+
## Compass
|
3
|
+
#################
|
4
|
+
/.sass-cache
|
5
|
+
|
6
|
+
#################
|
7
|
+
## Bundler
|
8
|
+
#################
|
9
|
+
*.gem
|
10
|
+
*.rbc
|
11
|
+
.bundle
|
12
|
+
.config
|
13
|
+
.yardoc
|
14
|
+
Gemfile.lock
|
15
|
+
InstalledFiles
|
16
|
+
_yardoc
|
17
|
+
coverage
|
18
|
+
doc/
|
19
|
+
lib/bundler/man
|
20
|
+
pkg
|
21
|
+
rdoc
|
22
|
+
spec/reports
|
23
|
+
test/tmp
|
24
|
+
test/version_tmp
|
25
|
+
tmp
|
26
|
+
|
27
|
+
#################
|
28
|
+
## Eclipse
|
29
|
+
#################
|
30
|
+
|
31
|
+
*.pydevproject
|
32
|
+
.project
|
33
|
+
.metadata
|
34
|
+
bin/
|
35
|
+
tmp/
|
36
|
+
*.tmp
|
37
|
+
*.bak
|
38
|
+
*.swp
|
39
|
+
*~.nib
|
40
|
+
local.properties
|
41
|
+
.classpath
|
42
|
+
.settings/
|
43
|
+
.loadpath
|
44
|
+
|
45
|
+
# External tool builders
|
46
|
+
.externalToolBuilders/
|
47
|
+
|
48
|
+
# Locally stored "Eclipse launch configurations"
|
49
|
+
*.launch
|
50
|
+
|
51
|
+
# CDT-specific
|
52
|
+
.cproject
|
53
|
+
|
54
|
+
# PDT-specific
|
55
|
+
.buildpath
|
56
|
+
|
57
|
+
|
58
|
+
#################
|
59
|
+
## Visual Studio
|
60
|
+
#################
|
61
|
+
|
62
|
+
## Ignore Visual Studio temporary files, build results, and
|
63
|
+
## files generated by popular Visual Studio add-ons.
|
64
|
+
|
65
|
+
# User-specific files
|
66
|
+
*.suo
|
67
|
+
*.user
|
68
|
+
*.sln.docstates
|
69
|
+
|
70
|
+
# Build results
|
71
|
+
[Dd]ebug/
|
72
|
+
[Rr]elease/
|
73
|
+
*_i.c
|
74
|
+
*_p.c
|
75
|
+
*.ilk
|
76
|
+
*.meta
|
77
|
+
*.obj
|
78
|
+
*.pch
|
79
|
+
*.pdb
|
80
|
+
*.pgc
|
81
|
+
*.pgd
|
82
|
+
*.rsp
|
83
|
+
*.sbr
|
84
|
+
*.tlb
|
85
|
+
*.tli
|
86
|
+
*.tlh
|
87
|
+
*.tmp
|
88
|
+
*.vspscc
|
89
|
+
.builds
|
90
|
+
*.dotCover
|
91
|
+
|
92
|
+
## TODO: If you have NuGet Package Restore enabled, uncomment this
|
93
|
+
#packages/
|
94
|
+
|
95
|
+
# Visual C++ cache files
|
96
|
+
ipch/
|
97
|
+
*.aps
|
98
|
+
*.ncb
|
99
|
+
*.opensdf
|
100
|
+
*.sdf
|
101
|
+
|
102
|
+
# Visual Studio profiler
|
103
|
+
*.psess
|
104
|
+
*.vsp
|
105
|
+
|
106
|
+
# ReSharper is a .NET coding add-in
|
107
|
+
_ReSharper*
|
108
|
+
|
109
|
+
# Installshield output folder
|
110
|
+
[Ee]xpress
|
111
|
+
|
112
|
+
# DocProject is a documentation generator add-in
|
113
|
+
DocProject/buildhelp/
|
114
|
+
DocProject/Help/*.HxT
|
115
|
+
DocProject/Help/*.HxC
|
116
|
+
DocProject/Help/*.hhc
|
117
|
+
DocProject/Help/*.hhk
|
118
|
+
DocProject/Help/*.hhp
|
119
|
+
DocProject/Help/Html2
|
120
|
+
DocProject/Help/html
|
121
|
+
|
122
|
+
# Click-Once directory
|
123
|
+
publish
|
124
|
+
|
125
|
+
# Others
|
126
|
+
[Bb]in
|
127
|
+
[Oo]bj
|
128
|
+
sql
|
129
|
+
TestResults
|
130
|
+
*.Cache
|
131
|
+
ClientBin
|
132
|
+
stylecop.*
|
133
|
+
~$*
|
134
|
+
*.dbmdl
|
135
|
+
Generated_Code #added for RIA/Silverlight projects
|
136
|
+
|
137
|
+
# Backup & report files from converting an old project file to a newer
|
138
|
+
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
139
|
+
_UpgradeReport_Files/
|
140
|
+
Backup*/
|
141
|
+
UpgradeLog*.XML
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
############
|
146
|
+
## Windows
|
147
|
+
############
|
148
|
+
|
149
|
+
# Windows image file caches
|
150
|
+
Thumbs.db
|
151
|
+
|
152
|
+
# Folder config file
|
153
|
+
Desktop.ini
|
154
|
+
|
155
|
+
|
156
|
+
#############
|
157
|
+
## Python
|
158
|
+
#############
|
159
|
+
|
160
|
+
*.py[co]
|
161
|
+
|
162
|
+
# Packages
|
163
|
+
*.egg
|
164
|
+
*.egg-info
|
165
|
+
dist
|
166
|
+
build
|
167
|
+
eggs
|
168
|
+
parts
|
169
|
+
bin
|
170
|
+
var
|
171
|
+
sdist
|
172
|
+
develop-eggs
|
173
|
+
.installed.cfg
|
174
|
+
|
175
|
+
# Installer logs
|
176
|
+
pip-log.txt
|
177
|
+
|
178
|
+
# Unit test / coverage reports
|
179
|
+
.coverage
|
180
|
+
.tox
|
181
|
+
|
182
|
+
#Translations
|
183
|
+
*.mo
|
184
|
+
|
185
|
+
#Mr Developer
|
186
|
+
.mr.developer.cfg
|
187
|
+
|
188
|
+
# Mac crap
|
189
|
+
.DS_Store
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/TODO.md
ADDED
data/bin/jumbler
CHANGED
data/jumbler.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
require 'jumbler/version'
|
6
|
+
require 'rbconfig'
|
7
|
+
|
8
|
+
Gem::Specification.new do |gemspec|
|
9
|
+
gemspec.name = "jumbler"
|
10
|
+
gemspec.version = Jumbler::VERSION
|
11
|
+
gemspec.date = Date.today
|
12
|
+
gemspec.summary = "Jumbler JS Combiner"
|
13
|
+
gemspec.description = "Uses Googles Closure Compiler to combine JS files into a single, better formed javascript"
|
14
|
+
gemspec.authors = ["Adam Cox"]
|
15
|
+
gemspec.email = "adamdama@hotmail.com"
|
16
|
+
gemspec.homepage = "https://github.com/adamdama/jumbler"
|
17
|
+
|
18
|
+
gemspec.files = `git ls-files`.split($/)
|
19
|
+
gemspec.executables = gemspec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
20
|
+
gemspec.test_files = gemspec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
gemspec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
gemspec.add_dependency "listen", "~> 0.6.0"
|
24
|
+
gemspec.add_dependency "rake"
|
25
|
+
|
26
|
+
# OS specific listen dependencies
|
27
|
+
gemspec.add_dependency 'rb-kqueue', '~> 0.2' if RbConfig::CONFIG['target_os'] =~ /freebsd/i
|
28
|
+
gemspec.add_dependency 'rb-fsevent', '~> 0.9.1' if RbConfig::CONFIG['target_os'] =~ /darwin(1.+)?$/i
|
29
|
+
gemspec.add_dependency 'rb-inotify', '~> 0.8.8', :github => 'mbj/rb-inotify' if RbConfig::CONFIG['target_os'] =~ /linux/i
|
30
|
+
gemspec.add_dependency 'wdm', '~> 0.0.3' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
31
|
+
|
32
|
+
gemspec.add_development_dependency "rspec"
|
33
|
+
gemspec.add_development_dependency "bundler"
|
34
|
+
end
|
data/lib/jumbler.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# and passing them to Googles closure compiler upon modification
|
4
4
|
# resulting in a minified file in a specified directory
|
5
5
|
#
|
6
|
-
# Inspired by Compass and Google
|
6
|
+
# Inspired by Compass and Google"s Closure Compiler
|
7
7
|
#
|
8
8
|
# Uses Listen library
|
9
9
|
#
|
@@ -11,26 +11,34 @@
|
|
11
11
|
# Requires java to be add to PATH
|
12
12
|
#
|
13
13
|
|
14
|
-
require
|
15
|
-
require
|
16
|
-
|
14
|
+
# require bundler
|
15
|
+
require "rubygems"
|
16
|
+
require "bundler/setup"
|
17
|
+
|
18
|
+
# application requirements
|
19
|
+
Bundler.require(:default, :development)
|
20
|
+
require "listen"
|
21
|
+
require "find"
|
22
|
+
#require "debugger"
|
23
|
+
|
24
|
+
require "jumbler/version"
|
17
25
|
|
18
26
|
class Jumbler
|
19
27
|
# initialize jumbler
|
20
28
|
def initialize args
|
21
|
-
@gcc_path = File.join(File.dirname(__FILE__),
|
22
|
-
@java_exec =
|
29
|
+
@gcc_path = File.join(File.dirname(__FILE__),"gcc","compiler.jar")
|
30
|
+
@java_exec = "java"
|
23
31
|
|
24
32
|
@current_dir = Dir.pwd
|
25
33
|
@watch_dir = @current_dir
|
26
|
-
@output_file = File.join(@watch_dir,
|
34
|
+
@output_file = File.join(@watch_dir, "jumbled.min.js")
|
27
35
|
# get all js files to be comiled
|
28
36
|
@js_file_paths = self.get_js @watch_dir
|
29
37
|
|
30
|
-
puts
|
38
|
+
puts "Jumbler is now looking for changes"
|
31
39
|
# listen to the specified folder for changes to js files
|
32
40
|
@listener = Listen.to(@watch_dir, :relative_paths => true, :filter => /\.js$/, :ignore => %r{ignored/path/}) do |modified, added, removed|
|
33
|
-
puts
|
41
|
+
puts "changes detected"
|
34
42
|
|
35
43
|
all_changes = modified + added + removed
|
36
44
|
|
@@ -38,7 +46,7 @@ class Jumbler
|
|
38
46
|
# stop if the change was the compiled file
|
39
47
|
unless(all_changes.length == 1 && "#{File.join(@watch_dir, all_changes[0])}" == @output_file)
|
40
48
|
|
41
|
-
puts
|
49
|
+
puts "recompilation needed"
|
42
50
|
if(added.length > 0)
|
43
51
|
# if a new file is added we need to add it to the array
|
44
52
|
added.each{|item|
|
@@ -76,7 +84,7 @@ class Jumbler
|
|
76
84
|
|
77
85
|
# creates the command to be used to run the closure compiler
|
78
86
|
def jumble
|
79
|
-
command =
|
87
|
+
command = ""
|
80
88
|
|
81
89
|
@js_file_paths.each {|item|
|
82
90
|
command += '--js "' + item + '" '
|
data/{README.md → readme.md}
RENAMED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jumbler
|
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:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: listen
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 0.6.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
30
46
|
- !ruby/object:Gem::Dependency
|
31
47
|
name: wdm
|
32
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,6 +59,38 @@ dependencies:
|
|
43
59
|
- - ~>
|
44
60
|
- !ruby/object:Gem::Version
|
45
61
|
version: 0.0.3
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: bundler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
46
94
|
description: Uses Googles Closure Compiler to combine JS files into a single, better
|
47
95
|
formed javascript
|
48
96
|
email: adamdama@hotmail.com
|
@@ -51,12 +99,17 @@ executables:
|
|
51
99
|
extensions: []
|
52
100
|
extra_rdoc_files: []
|
53
101
|
files:
|
54
|
-
-
|
102
|
+
- .gitignore
|
103
|
+
- CHANGELOG.md
|
104
|
+
- Gemfile
|
105
|
+
- Rakefile
|
106
|
+
- TODO.md
|
55
107
|
- bin/jumbler
|
108
|
+
- jumbler.gemspec
|
56
109
|
- lib/gcc/compiler.jar
|
57
110
|
- lib/jumbler.rb
|
58
|
-
- lib/
|
59
|
-
-
|
111
|
+
- lib/jumbler/version.rb
|
112
|
+
- readme.md
|
60
113
|
homepage: https://github.com/adamdama/jumbler
|
61
114
|
licenses: []
|
62
115
|
post_install_message:
|