mes 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +32 -0
  5. data/Rakefile +1 -0
  6. data/bin/mes +11 -0
  7. data/lib/middleman_ember_scaffold/cli/generators.rb +21 -0
  8. data/lib/middleman_ember_scaffold/cli.rb +91 -0
  9. data/lib/middleman_ember_scaffold/generators/scaffold.rb +22 -0
  10. data/lib/middleman_ember_scaffold/load_paths.rb +1 -0
  11. data/lib/middleman_ember_scaffold/template/Capfile +4 -0
  12. data/lib/middleman_ember_scaffold/template/Gemfile +10 -0
  13. data/lib/middleman_ember_scaffold/template/README.md +30 -0
  14. data/lib/middleman_ember_scaffold/template/component.json +14 -0
  15. data/lib/middleman_ember_scaffold/template/components/ember/component.json +20 -0
  16. data/lib/middleman_ember_scaffold/template/components/ember/ember.js +27755 -0
  17. data/lib/middleman_ember_scaffold/template/components/ember/ember.min.js +20 -0
  18. data/lib/middleman_ember_scaffold/template/components/ember-data/README.md +4 -0
  19. data/lib/middleman_ember_scaffold/template/components/ember-data/component.json +22 -0
  20. data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data-spade.js +1 -0
  21. data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.amd.js +7819 -0
  22. data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.js +8769 -0
  23. data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.min.js +12 -0
  24. data/lib/middleman_ember_scaffold/template/components/ember-data/ember-data.prod.js +7802 -0
  25. data/lib/middleman_ember_scaffold/template/components/handlebars/component.json +17 -0
  26. data/lib/middleman_ember_scaffold/template/components/handlebars/handlebars.js +2201 -0
  27. data/lib/middleman_ember_scaffold/template/components/handlebars/handlebars.runtime.js +321 -0
  28. data/lib/middleman_ember_scaffold/template/components/jquery/component.json +14 -0
  29. data/lib/middleman_ember_scaffold/template/components/jquery/composer.json +26 -0
  30. data/lib/middleman_ember_scaffold/template/components/jquery/jquery-migrate.js +496 -0
  31. data/lib/middleman_ember_scaffold/template/components/jquery/jquery-migrate.min.js +3 -0
  32. data/lib/middleman_ember_scaffold/template/components/jquery/jquery.js +9597 -0
  33. data/lib/middleman_ember_scaffold/template/components/jquery/jquery.min.js +5 -0
  34. data/lib/middleman_ember_scaffold/template/config/deploy.rb +66 -0
  35. data/lib/middleman_ember_scaffold/template/config.rb +91 -0
  36. data/lib/middleman_ember_scaffold/template/source/app/application.coffee +15 -0
  37. data/lib/middleman_ember_scaffold/template/source/app/controllers/application_controller.coffee +1 -0
  38. data/lib/middleman_ember_scaffold/template/source/app/controllers/index_controller.coffee +1 -0
  39. data/lib/middleman_ember_scaffold/template/source/app/main.coffee +17 -0
  40. data/lib/middleman_ember_scaffold/template/source/app/models/foo.coffee +1 -0
  41. data/lib/middleman_ember_scaffold/template/source/app/routes.coffee +11 -0
  42. data/lib/middleman_ember_scaffold/template/source/app/views/application_view.coffee +2 -0
  43. data/lib/middleman_ember_scaffold/template/source/app/views/index_view.coffee +2 -0
  44. data/lib/middleman_ember_scaffold/template/source/index.html.haml +1 -0
  45. data/lib/middleman_ember_scaffold/template/source/layout.haml +8 -0
  46. data/lib/middleman_ember_scaffold/template/source/stylesheets/application.css.scss +2 -0
  47. data/lib/middleman_ember_scaffold/template/source/stylesheets/variables.scss +279 -0
  48. data/lib/middleman_ember_scaffold/template/source/templates_emblem/application/index.emblem +2 -0
  49. data/lib/middleman_ember_scaffold/template/source/templates_emblem/application.emblem +4 -0
  50. data/lib/middleman_ember_scaffold/template/vendor/javascripts/.gitkeep +0 -0
  51. data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-dropdown.js +165 -0
  52. data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-modal.js +374 -0
  53. data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-modalmanager.js +412 -0
  54. data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-popover.js +114 -0
  55. data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-tabs.js +144 -0
  56. data/lib/middleman_ember_scaffold/template/vendor/javascripts/bootstrap-tooltip.js +361 -0
  57. data/lib/middleman_ember_scaffold/template/vendor/javascripts/date.js +104 -0
  58. data/lib/middleman_ember_scaffold/template/vendor/javascripts/ember-data.js +8769 -0
  59. data/lib/middleman_ember_scaffold/template/vendor/javascripts/ember.js +27755 -0
  60. data/lib/middleman_ember_scaffold/template/vendor/javascripts/handlebars.js +2201 -0
  61. data/lib/middleman_ember_scaffold/template/vendor/javascripts/jquery.js +9597 -0
  62. data/lib/middleman_ember_scaffold/template/vendor/javascripts/jquery.validate.min.js +2 -0
  63. data/lib/middleman_ember_scaffold/template/vendor/javascripts/json2.js +480 -0
  64. data/lib/middleman_ember_scaffold/template/vendor/javascripts/underscore.js +1 -0
  65. data/lib/middleman_ember_scaffold/template/vendor/javascripts/utils.js +19 -0
  66. data/lib/middleman_ember_scaffold/template/vendor/stylesheets/.gitkeep +0 -0
  67. data/lib/middleman_ember_scaffold/template/watch +2 -0
  68. data/lib/middleman_ember_scaffold/version.rb +3 -0
  69. data/lib/middleman_ember_scaffold.rb +5 -0
  70. data/mes.gemspec +24 -0
  71. metadata +167 -0
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in middleman_ember_scaffold.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 j-mcnally
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # MiddlemanEmberScaffold
2
+
3
+ A gem to easily scaffold middleman projects that leverage EmberJS, Emblem and Bootstrap.
4
+
5
+ Emblem is basically haml for Handlebars.
6
+
7
+ Also includes some sweet bootstrap sweetness.
8
+
9
+ I mean cloning a boilerplate repo isn't as cool.
10
+
11
+ The commandline boilerplate was "borrowed" from middleman.
12
+
13
+ ## Installation
14
+
15
+ $ gem install mes
16
+
17
+ ## Usage
18
+
19
+ mes help
20
+
21
+ -or
22
+
23
+ mes new [folder]
24
+
25
+
26
+ ## Contributing
27
+
28
+ 1. Fork it
29
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
30
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
31
+ 4. Push to the branch (`git push origin my-new-feature`)
32
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/mes ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'middleman_ember_scaffold/load_paths'
5
+
6
+ CWD=`pwd`.rstrip
7
+
8
+
9
+
10
+ # Start the CLI
11
+ MiddlemanEmberScaffold::Cli::Base.start
@@ -0,0 +1,21 @@
1
+ module MiddlemanEmberScaffold::Cli
2
+ class Generators < Thor
3
+ include Thor::Actions
4
+ check_unknown_options!
5
+ namespace :new
6
+ desc "new [path]", "Generate a new scaffold in a folder"
7
+ method_option :path,
8
+ :aliases => "-p",
9
+ :default => '.',
10
+ :desc => "The folder to scaffold into."
11
+ def new
12
+ #do thor stuff
13
+ target_path=File.expand_path(File.join("#{CWD}", "#{options['path']}"))
14
+ say "Generating Middleman-Ember-Scaffold in #{target_path}"
15
+ require "middleman_ember_scaffold/generators/scaffold"
16
+ scaffolder = MiddlemanEmberScaffold::Generators::Scaffold.new
17
+ scaffolder.invoke :scaffold, [target_path]
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,91 @@
1
+ # Require thor since that's what the who CLI is built around
2
+ require 'thor'
3
+ require "thor/group"
4
+
5
+ # CLI Module
6
+ module MiddlemanEmberScaffold
7
+
8
+ module Cli
9
+
10
+ # The base task from which everything else etends
11
+ class Base < Thor
12
+ class << self
13
+ def start(*args)
14
+ # Change flag to a module
15
+ ARGV.unshift("help") if ARGV.delete("--help")
16
+
17
+ unless ARGV[1].nil? || ARGV[1].include?("-")
18
+ ARGV.push ARGV[1]
19
+ ARGV[1] = '-p'
20
+ end
21
+
22
+ # Default command is server
23
+ if ARGV[0] != "help" && (ARGV.length < 1 || ARGV.first.include?("-"))
24
+ ARGV.unshift("help")
25
+ end
26
+ super
27
+ end
28
+ end
29
+
30
+ desc "version", "Show version"
31
+ def version
32
+ require 'middleman_ember_scaffold/version'
33
+ say "mes #{MiddlemanEmberScaffold::VERSION}"
34
+ end
35
+
36
+
37
+
38
+ # Override the Thor help method to find help for subtasks
39
+ # @param [Symbol, String, nil] meth
40
+ # @param [Boolean] subcommand
41
+ # @return [void]
42
+ def help(meth = nil, subcommand = false)
43
+ if meth && !self.respond_to?(meth)
44
+ klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
45
+ klass.start(["-h", task].compact, :shell => self.shell)
46
+ else
47
+ list = []
48
+ Thor::Util.thor_classes_in(MiddlemanEmberScaffold::Cli).each do |thor_class|
49
+ list += thor_class.printable_tasks(false)
50
+ end
51
+ list.sort!{ |a,b| a[0] <=> b[0] }
52
+
53
+ shell.say "Tasks:"
54
+ shell.print_table(list, :ident => 2, :truncate => true)
55
+ shell.say
56
+ end
57
+ end
58
+
59
+ # Intercept missing methods and search subtasks for them
60
+ # @param [Symbol] meth
61
+ def method_missing(meth, *args)
62
+ meth = meth.to_s
63
+
64
+ if self.class.map.has_key?(meth)
65
+ meth = self.class.map[meth]
66
+ end
67
+
68
+ klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
69
+
70
+ if klass.nil?
71
+ tasks_dir = File.join(Dir.pwd, "tasks")
72
+
73
+ if File.exists?(tasks_dir)
74
+ Dir[File.join(tasks_dir, "**/*_task.rb")].each { |f| require f }
75
+ klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
76
+ end
77
+ end
78
+
79
+ if klass.nil?
80
+ raise Thor::Error.new "There's no '#{meth}' command for mes. Try 'mes help' for a list of commands."
81
+ else
82
+ args.unshift(task) if task
83
+ klass.start(args, :shell => self.shell)
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+
90
+
91
+ require "middleman_ember_scaffold/cli/generators"
@@ -0,0 +1,22 @@
1
+ module MiddlemanEmberScaffold
2
+ module Generators
3
+ class Scaffold < Thor
4
+ include Thor::Actions
5
+ def self.source_root
6
+ File.expand_path(File.dirname(__FILE__), "../template")
7
+ end
8
+
9
+ desc "build scaffold", "Build a scaffold for a Middleman Ember Project"
10
+ def scaffold(*args)
11
+ destination_root=args[0]
12
+ src = File.expand_path(File.join(File.dirname(__FILE__), "../template"))
13
+ directory(src, destination_root)
14
+ puts 'Running bundle install.......'
15
+ puts %x[bash -l -c 'cd #{destination_root}; bundle install']
16
+ puts 'Building scaffold....'
17
+ puts %x[bash -l -c 'cd #{destination_root}; middleman build']
18
+ end
19
+
20
+ end
21
+ end
22
+ end
@@ -0,0 +1 @@
1
+ require "middleman_ember_scaffold/cli"
@@ -0,0 +1,4 @@
1
+ load 'deploy'
2
+ # Uncomment if you are using Rails' asset pipeline
3
+ # load 'deploy/assets'
4
+ load 'config/deploy' # remove this line to skip loading any of the default tasks
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "middleman", "~>3.0.13"
4
+ gem "middleman-livereload"
5
+ gem "middleman-emblem", "~> 1.0.0"
6
+ gem 'bootstrap-sass', '~> 2.3.1.0', :require => false
7
+
8
+ group :development do
9
+ gem 'capistrano', '2.12.0'
10
+ end
@@ -0,0 +1,30 @@
1
+ middleman-ember-template: with Ember.js
2
+ =======================================
3
+
4
+ **Template Layout**
5
+
6
+ source/
7
+ index.html
8
+ stylesheets/
9
+ images/
10
+ app/
11
+ main.js
12
+ routes.js
13
+ controllers/ foo_controller.js
14
+ views/ foo_view.js
15
+ templates/ foo.handlebars
16
+ models/ foo.js
17
+ vendor/
18
+ javascripts/
19
+ stylesheets/
20
+
21
+ You may also want to checkout the [Ember.js with Middleman example](https://github.com/GutenYe/example-ember-with-middleman).
22
+
23
+ Usage
24
+ -----
25
+
26
+ 1. Download and install into ~/.middleman/ember (you'll need to create the directory it doesn't already exist)
27
+
28
+ 2. Initialize a new middleman project with `middleman init my_project --template=ember`
29
+
30
+ You can read more about project templates on the [Middleman site](http://middlemanapp.com/getting-started/welcome/).
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "mes",
3
+ "version": "0.0.1",
4
+ "ignore": [
5
+ "**/.*",
6
+ "node_modules",
7
+ "components"
8
+ ],
9
+ "dependencies": {
10
+ "jquery": "1.9.1",
11
+ "ember": "1.0.0-rc.1",
12
+ "ember-data": "git@github.com:croogie/ember-data.git"
13
+ }
14
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "ember",
3
+ "version": "1.0.0-rc.1",
4
+ "main": [
5
+ "./ember.js",
6
+ "./ember.min.js"
7
+ ],
8
+ "dependencies": {
9
+ "jquery": "~1.9.0",
10
+ "handlebars": "~1.0.0"
11
+ },
12
+ "gitHead": "daa4be2212e47af0561c62527a8bd487840a1154",
13
+ "_id": "ember@1.0.0-rc.1",
14
+ "readme": "ERROR: No README.md file found!",
15
+ "description": "ERROR: No README.md file found!",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git://github.com/components/ember"
19
+ }
20
+ }