Skip to content

Commit

Permalink
initial sceleton
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Dec 27, 2011
1 parent 6e1f8d0 commit 463313e
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions .rvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rvm ruby-1.9.3-p0@pivotal_rocket_gems --create
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source 'http://rubygems.org'

gem "rake", "~> 0.9.0"
gem 'sprockets', '~> 2.0'
gem "coffee-script", "~> 2.2.0"
gem "uglifier", ">= 1.2.0"
gem "therubyracer", ">= 0.9.9"
gem "less"
gem "jasmine", ">= 1.0.0"
gem "actionpack", ">= 3.1.0"
gem "activesupport", ">= 3.1.0"
44 changes: 44 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env rake
require 'rake'
require 'coffee-script'
require 'uglifier'

desc 'Default: compress js and css.'
task :default => :'pack:default'

#########################################
### JS and CSS tasks
#########################################

namespace :pack do
desc "do all pack tasks"
task :default => [:compile]

desc "compile coffee-scripts from ./assets/javascripts to ./javascripts"
task :compile do
source = "#{File.dirname(__FILE__)}/assets/javascripts/"
javascripts = "#{File.dirname(__FILE__)}/javascripts/"

Dir.foreach(source) do |cf|
unless cf == '.' || cf == '..'
js_compiled = CoffeeScript.compile File.read("#{source}#{cf}")
js = Uglifier.compile js_compiled
open "#{javascripts}#{cf.gsub('.coffee', '.js')}", 'w' do |f|
f.puts js
end
end
end

puts "All done."
end
end

begin
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
rescue LoadError
task :jasmine do
abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
end
end

4 changes: 4 additions & 0 deletions assets/javascripts/pivotal_api_lib.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class window.PivotalApiLib
constructor: ->
console.log "init"

1 change: 1 addition & 0 deletions javascripts/pivotal_api_lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
((function(){window.PivotalApiLib=function(){function a(){console.log("init")}return a}()})).call(this)

0 comments on commit 463313e

Please sign in to comment.