-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed lib directory and used src instead. Moved license.js outside of the source directory. Created a geometries directory inside src. Also had problems getting the Ruby rake file to build a minified file with uglifiy, so after a bit of searching I found that many people suggested to include the json-pure gem, so I added it to the Gemfile
- Loading branch information
Showing
7 changed files
with
2,363 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source :rubygems | ||
|
||
gem 'json-pure' | ||
gem 'rake' | ||
gem 'uglifier' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
execjs (1.3.0) | ||
multi_json (~> 1.0) | ||
multi_json (1.1.0) | ||
rake (0.9.2.2) | ||
uglifier (1.2.3) | ||
execjs (>= 0.3.0) | ||
multi_json (>= 1.0.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
rake | ||
uglifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require 'json/pure' | ||
|
||
# This is the list of files to concatenate. The first file will appear at the top of the final file. All files are relative to the lib directory. | ||
FILES = [ | ||
"license.js", "src/GlobalObject.js", "src/Node.js", "src/Container.js", "src/Stage.js", | ||
"src/Layer.js", "src/Group.js", "src/geometries/Shape.js", "src/geometries/Rect.js", "src/geometries/Circle.js", "src/geometries/Image.js", | ||
"src/geometries/Polygon.js", "src/geometries/RegularPolygon.js", "src/geometries/Star.js", "src/geometries/Text.js" | ||
] | ||
|
||
def concatenate | ||
content = "" | ||
FILES.each do |file| | ||
content << IO.read(File.expand_path(file)) << "\n" | ||
end | ||
|
||
return content | ||
end | ||
|
||
namespace :build do | ||
desc "Concatenate all the js files into /dist/kinetic.js." | ||
task :dev do | ||
puts ":: Building the file /dist/kinetic.js..." | ||
File.open("dist/kinetic.js", "w") do |file| | ||
file.puts concatenate() | ||
end | ||
puts " -> Done!" | ||
end | ||
|
||
desc "Concatenate all the js files in into /dist/kinetic.min.js and minify it." | ||
task :prod do | ||
puts ":: Building the file /dist/kinetic.min.js..." | ||
require 'json/pure' | ||
require 'uglifier' | ||
File.open("dist/kinetic.min.js", "w") do |file| | ||
file.puts Uglifier.compile(concatenate()) | ||
end | ||
puts ":: Minifying the file /dist/kinetic.min.js..." | ||
puts " -> Done!" | ||
end | ||
end |
Oops, something went wrong.