Permalink
Browse files

changed class syntax

  • Loading branch information...
1 parent 250b55b commit ba3eca6558538e650f8261ccb6ef95587f378d5e @collin committed Dec 7, 2012
Showing with 2,283 additions and 378 deletions.
  1. +1 −1 Assetfile
  2. +2 −1 Gemfile
  3. +20 −4 Gemfile.lock
  4. +53 −0 Rakefile
  5. +2 −2 alpha_simprini.erb
  6. +8 −0 alpha_simprini.sublime-project
  7. +1,726 −0 alpha_simprini.sublime-workspace
  8. +0 −39 autotest.watchr
  9. +1 −1 docs/AlphaSimprini-docs.js
  10. +26 −17 docs/doc.js
  11. +42 −3 docs/index.html
  12. +1 −0 sharejs.js
  13. +5 −4 src/alpha_simprini.coffee
  14. +1 −1 src/alpha_simprini/client/application.coffee
  15. +1 −1 src/alpha_simprini/client/binding.coffee
  16. +1 −1 src/alpha_simprini/client/binding/check_box.coffee
  17. +1 −1 src/alpha_simprini/client/binding/container.coffee
  18. +1 −1 src/alpha_simprini/client/binding/edit_line.coffee
  19. +1 −1 src/alpha_simprini/client/binding/field.coffee
  20. +1 −1 src/alpha_simprini/client/binding/file.coffee
  21. +3 −1 src/alpha_simprini/client/binding/if.coffee
  22. +1 −1 src/alpha_simprini/client/binding/input.coffee
  23. +1 −1 src/alpha_simprini/client/binding/many.coffee
  24. +1 −1 src/alpha_simprini/client/binding/model.coffee
  25. +1 −1 src/alpha_simprini/client/binding/one.coffee
  26. +1 −1 src/alpha_simprini/client/binding/select.coffee
  27. +1 −2 src/alpha_simprini/client/binding_group.coffee
  28. +2 −1 src/alpha_simprini/client/dom.coffee
  29. +4 −3 src/alpha_simprini/client/key_router.coffee
  30. +8 −4 src/alpha_simprini/client/models/targets.coffee
  31. +1 −1 src/alpha_simprini/client/view.coffee
  32. +1 −1 src/alpha_simprini/client/view_events.coffee
  33. +1 −1 src/alpha_simprini/client/view_model.coffee
  34. +3 −2 src/alpha_simprini/client/views/dialog.coffee
  35. +3 −1 src/alpha_simprini/client/views/panel.coffee
  36. +9 −6 src/alpha_simprini/client/views/region.coffee
  37. +0 −13 src/alpha_simprini/client/views/stage.coffee
  38. +1 −1 src/alpha_simprini/core/callbacks.coffee
  39. +1 −1 src/alpha_simprini/core/collection.coffee
  40. +2 −1 src/alpha_simprini/core/filtered_collection.coffee
  41. +3 −2 src/alpha_simprini/core/model.coffee
  42. +2 −2 src/alpha_simprini/core/model/dendrite.coffee
  43. +72 −12 src/alpha_simprini/core/model/post_message.coffee
  44. +2 −1 src/alpha_simprini/core/model/rest.coffee
  45. +39 −27 src/alpha_simprini/core/model/share.coffee
  46. +2 −1 src/alpha_simprini/core/model/store.coffee
  47. +5 −3 src/alpha_simprini/core/model/synapse.coffee
  48. +1 −1 src/alpha_simprini/core/models/file.coffee
  49. +1 −1 src/alpha_simprini/core/models/group.coffee
  50. +1 −1 src/alpha_simprini/core/models/grouping.coffee
  51. +1 −1 src/alpha_simprini/core/models/multiple_selection_model.coffee
  52. +1 −1 src/alpha_simprini/core/models/radio_selection_model.coffee
  53. +12 −12 src/alpha_simprini/core/properties/belongs_to.coffee
  54. +118 −117 src/alpha_simprini/core/properties/field.coffee
  55. +39 −38 src/alpha_simprini/core/properties/has_many.coffee
  56. +1 −2 src/alpha_simprini/core/properties/has_one.coffee
  57. +3 −2 src/alpha_simprini/core/properties/virtual_property.coffee
  58. +1 −1 src/alpha_simprini/core/state_machine.coffee
  59. +5 −2 src/alpha_simprini/css.coffee
  60. +1 −1 src/alpha_simprini/css/models/angle.coffee
  61. +2 −1 src/alpha_simprini/css/models/color.coffee
  62. +1 −1 src/alpha_simprini/css/models/color_stop.coffee
  63. +2 −1 src/alpha_simprini/css/models/color_stops.coffee
  64. +1 −5 src/alpha_simprini/css/models/font_family.coffee
  65. +1 −1 src/alpha_simprini/css/models/font_size.coffee
  66. +1 −1 src/alpha_simprini/css/models/length.coffee
  67. +1 −1 src/alpha_simprini/css/models/margin.coffee
  68. +1 −1 src/alpha_simprini/css/models/padding.coffee
  69. +1 −1 src/alpha_simprini/css/models/percent.coffee
  70. +1 −1 src/alpha_simprini/css/models/siding.coffee
  71. +1 −1 src/alpha_simprini/css/views/angle_picker.coffee
  72. +1 −1 src/alpha_simprini/css/views/color_picker.coffee
  73. +4 −2 src/alpha_simprini/css/views/color_stop_picker.coffee
  74. +1 −1 src/alpha_simprini/css/views/dialogs/color.coffee
  75. +1 −1 src/alpha_simprini/keyboard/models/zone.coffee
  76. +1 −1 src/alpha_simprini/keyboard/models/zone_controller.coffee
  77. +1 −1 src/alpha_simprini/keyboard/models/zone_group.coffee
  78. +1 −1 src/alpha_simprini/keyboard/views/destructable.coffee
  79. +1 −1 src/alpha_simprini/keyboard/views/keyboard_navigation.coffee
  80. +1 −1 src/alpha_simprini/keyboard/views/selectable.coffee
  81. +1 −1 src/alpha_simprini/keyboard/views/zone.coffee
  82. +8 −1 src/doc.coffee
View
@@ -5,7 +5,7 @@ require "json"
output "dist"
input "lib" do
match "**/*.js" do
- minispade rewrite_requires: true, string: true, module_id_generator: proc { |input|
+ minispade rewrite_requires: true, module_id_generator: proc { |input|
id = input.path.dup
id.sub!('/lib/', '/')
id.sub!(/\.js$/, '')
View
@@ -3,11 +3,12 @@ source "https://rubygems.org"
gem "rake-pipeline", :git => "https://github.com/livingsocial/rake-pipeline.git"
gem "rake-pipeline-web-filters", :git => "https://github.com/wycats/rake-pipeline-web-filters.git"
+gem "pathology-rake", git: "git://gist.github.com/4194390.git"
gem "colored"
gem "uglifier", "~> 1.0.3"
gem "coffee-script"
gem "github_uploader", "~> 0.1.0", require: false
-gem "html_package", "~> 0.0.3"
+gem "html_package", github:"collin/html_package", branch:"master"
gem "tilt"
gem "rake"
gem "watchr"
View
@@ -1,4 +1,20 @@
GIT
+ remote: git://gist.github.com/4194390.git
+ revision: 58b17c2276b7b4df6e6743f408df651d5db49184
+ specs:
+ pathology-rake (0.2.0)
+
+GIT
+ remote: git://github.com/collin/html_package.git
+ revision: 2d94d506a91a9f2b0dbe461882288796c28599c7
+ branch: master
+ specs:
+ html_package (0.0.7)
+ colored (>= 1.2)
+ nokogiri (~> 1.5.2)
+ thor (>= 0.14)
+
+GIT
remote: https://github.com/livingsocial/rake-pipeline.git
revision: 543f4322fe70facee9572d29ddabf7f090dad68a
specs:
@@ -39,19 +55,18 @@ GEM
github_api (= 0.4.11)
rest-client
hashie (1.2.0)
- html_package (0.0.3)
mime-types (1.18)
multi_json (1.3.2)
multipart-post (1.1.5)
- nokogiri (1.5.2)
+ nokogiri (1.5.5)
oauth2 (0.5.2)
faraday (~> 0.7)
multi_json (~> 1.0)
rack (1.4.1)
rake (0.9.2.2)
rest-client (1.6.7)
mime-types (>= 1.16)
- thor (0.14.6)
+ thor (0.16.0)
tilt (1.3.3)
uglifier (1.0.4)
execjs (>= 0.3.0)
@@ -65,7 +80,8 @@ DEPENDENCIES
coffee-script
colored
github_uploader (~> 0.1.0)
- html_package (~> 0.0.3)
+ html_package!
+ pathology-rake!
rake
rake-pipeline!
rake-pipeline-web-filters!
View
@@ -1,6 +1,7 @@
abort "Use Ruby 1.9 to build Alpha Simprini" unless RUBY_VERSION["1.9"]
require 'rake-pipeline'
+require 'pathology-rake'
require 'colored'
require 'github_uploader'
@@ -151,3 +152,55 @@ task :release, [:version] => [:clean, :test] do |t, args|
system "git push origin #{args[:version]}"
Rake::Task[:upload].invoke
end
+
+SourceFiles = FileList[File.expand_path("src/**/*.coffee")]
+
+CLASS_FILTER = /^([\w+\.?]+) = ([\w+\.?]+).extend.+$/
+X_CLASS_FILTER = /^([\w+\.?]+)\._class "([\w]+)", ([\w+\.?]+), .+$/
+MODULE_FILTER = /^([ ]*?)module ([\w+\.?]+)[ ]*?$/
+
+desc "upgrade syntax to newer ruby like syntax"
+file :rewrite_alpha_simprini_ruby_modules, SourceFiles do |t|
+ SourceFiles.each do |file|
+ content = File.open(file).read
+ content.gsub!(CLASS_FILTER) do |match|
+ print "."
+ name = $2.split(".")
+ unless name.length > 1
+ STDERR.puts "Cannot define class outside a namespace #{$2} \n @ #{input.fullpath}"
+ end
+ extender = if $2 && $2 != "Pathology.Object"
+ " < #{$2}"
+ else
+ ""
+ end
+
+ puts %|class #{$1}#{extender}\n|
+ end
+
+ content.gsub!(X_CLASS_FILTER) do |match|
+ print "."
+ extender = if $3 && $3 != "Pathology.Object"
+ " < #{$3}"
+ else
+ ""
+ end
+ puts %|class #{$1}.#{$2}#{extender}\n|
+ end
+
+ # content.gsub!(MODULE_FILTER) do
+ # print "."
+ # name = $2.split(".")
+ # if name.length == 1
+ # puts %|#{$1}this.#{$2} = Pathology.Namespace.new "#{$2}"\n|
+ # else
+ # key = name.pop
+ # puts %|#{$1}#{name * '.'}._module "#{key}", ({delegate, include, def, defs}) ->\n|
+ # end
+ # end
+
+ File.open(file, "w+") do |handle|
+ handle.write content
+ end
+ end
+end
View
@@ -19,13 +19,13 @@
href="http://spader.herokuapp.com/spades/jwerty-0.3.0.js">
<link rel="dependency" type="text/package+html"
- href="http://cloud.github.com/downloads/collin/pathology/pathology-0.3.1.html">
+ href="http://cloud.github.com/downloads/collin/pathology/pathology-0.4.1.html">
<link rel="dependency" type="text/package+html"
href="http://cloud.github.com/downloads/collin/knead/knead-0.3.3.html">
<link rel="dependency" type="text/package+html"
- href="http://cloud.github.com/downloads/collin/taxi/taxi-0.3.1.html">
+ href="http://cloud.github.com/downloads/collin/taxi/taxi-0.6.0.html">
<link rel="dependency" type="text/spade+javascript"
href="http://spader.herokuapp.com/spades/fleck-0.5.1.js">
@@ -0,0 +1,8 @@
+{
+ "folders":
+ [
+ {
+ "path": "/Users/collin/Code/alpha_simprini"
+ }
+ ]
+}
Oops, something went wrong.

0 comments on commit ba3eca6

Please sign in to comment.