middleman-ember 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +62 -0
- data/Rakefile +1 -0
- data/lib/middleman/ember/extension.rb +49 -0
- data/lib/middleman/ember/version.rb +5 -0
- data/lib/middleman/ember.rb +9 -0
- data/lib/middleman_extension.rb +1 -0
- data/middleman-ember.gemspec +27 -0
- metadata +137 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Andy Shipman
|
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,62 @@
|
|
1
|
+
# Middleman::Ember
|
2
|
+
|
3
|
+
Adds Ember assets to a Middleman project. Support for production version of Ember when building.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'middleman-ember'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install middleman-ember
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Add the following code to your `config.rb` file:
|
22
|
+
```ruby
|
23
|
+
activate: :ember
|
24
|
+
```
|
25
|
+
|
26
|
+
Set the production variant in your build configuration:
|
27
|
+
```ruby
|
28
|
+
configure :build do
|
29
|
+
set :ember_variant, :production
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
The gem uses handlebars-source, ember-source and ember-data-source for the Ember assets. If you want to have specific versions of ember, ember-data or handlebars specify those in your Gemfile, e.g:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
gem "handlebars-source", "~> 1.0.0.rc3"
|
37
|
+
gem "ember-source", "~>1.0.0.rc3"
|
38
|
+
gem "ember-data-source", "~> 0.0.5"
|
39
|
+
|
40
|
+
```
|
41
|
+
|
42
|
+
There are 3 helpers that expose the asset paths of the ember assets used, namely:
|
43
|
+
* ember_asset_path
|
44
|
+
* handlebars_asset_path
|
45
|
+
* ember_local_path
|
46
|
+
|
47
|
+
These are useful if you're using the [middleman-jasmine](https://github.com/mrship/middleman-jasmine) gem to allow you to add the ember and handlebars assets to another sprockets instance. e.g.:
|
48
|
+
```ruby
|
49
|
+
after_configuration do
|
50
|
+
jasmine_sprockets.append_path(ember_asset_path)
|
51
|
+
jasmine_sprockets.append_path(handlebars_asset_path)
|
52
|
+
jasmine_sprockets.prepend_path(ember_local_path) unless ember_local_path.nil?
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
## Contributing
|
57
|
+
|
58
|
+
1. Fork it
|
59
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
60
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
61
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
62
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'middleman-core'
|
2
|
+
|
3
|
+
module Middleman
|
4
|
+
module Ember
|
5
|
+
class << self
|
6
|
+
def registered(app, options_hash={}, &block)
|
7
|
+
app.send :include, InstanceMethods
|
8
|
+
app.set :ember_variant, :development
|
9
|
+
|
10
|
+
app.after_configuration do
|
11
|
+
ember_version =
|
12
|
+
if app.ember_variant == :production
|
13
|
+
"prod."
|
14
|
+
else
|
15
|
+
""
|
16
|
+
end
|
17
|
+
|
18
|
+
FileUtils.mkdir_p(ember_asset_path)
|
19
|
+
FileUtils.cp(::Ember::Source.bundled_path_for("ember.#{ember_version}js"), ember_asset_path.join("ember.js"))
|
20
|
+
FileUtils.cp(::Ember::Data::Source.bundled_path_for("ember-data.#{ember_version}js"), ember_asset_path.join("ember-data.js"))
|
21
|
+
sprockets.append_path(ember_asset_path)
|
22
|
+
|
23
|
+
# allow for a local Ember variant
|
24
|
+
sprockets.prepend_path(ember_local_path) unless ember_local_path.nil?
|
25
|
+
|
26
|
+
# add in Handlebars path
|
27
|
+
sprockets.append_path(handlebars_asset_path)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
alias :included :registered
|
31
|
+
end
|
32
|
+
|
33
|
+
module InstanceMethods
|
34
|
+
def ember_asset_path
|
35
|
+
Pathname.new(File.join("#{root}/tmp/middleman-ember"))
|
36
|
+
end
|
37
|
+
|
38
|
+
def handlebars_asset_path
|
39
|
+
File.dirname(::Handlebars::Source.bundled_path)
|
40
|
+
end
|
41
|
+
|
42
|
+
def ember_local_path
|
43
|
+
local_path = "#{root}/vendor/assets/ember"
|
44
|
+
File.directory?(local_path) ? local_path : nil
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'middleman/ember'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'middleman/ember/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "middleman-ember"
|
8
|
+
spec.version = Middleman::Ember::VERSION
|
9
|
+
spec.authors = ["Andy Shipman"]
|
10
|
+
spec.email = ["andy@cllearview.com"]
|
11
|
+
spec.description = "Ember support for Middleman"
|
12
|
+
spec.summary = "Add Ember assets to a Middleman project. Support for production version of Ember when building."
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'middleman-core'
|
22
|
+
spec.add_dependency 'ember-source'
|
23
|
+
spec.add_dependency 'ember-data-source'
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
26
|
+
spec.add_development_dependency "rake"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: middleman-ember
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Andy Shipman
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: middleman-core
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: ember-source
|
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'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: ember-data-source
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.3'
|
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: '1.3'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
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'
|
94
|
+
description: Ember support for Middleman
|
95
|
+
email:
|
96
|
+
- andy@cllearview.com
|
97
|
+
executables: []
|
98
|
+
extensions: []
|
99
|
+
extra_rdoc_files: []
|
100
|
+
files:
|
101
|
+
- .gitignore
|
102
|
+
- Gemfile
|
103
|
+
- LICENSE.txt
|
104
|
+
- README.md
|
105
|
+
- Rakefile
|
106
|
+
- lib/middleman/ember.rb
|
107
|
+
- lib/middleman/ember/extension.rb
|
108
|
+
- lib/middleman/ember/version.rb
|
109
|
+
- lib/middleman_extension.rb
|
110
|
+
- middleman-ember.gemspec
|
111
|
+
homepage: ''
|
112
|
+
licenses:
|
113
|
+
- MIT
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - ! '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ! '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 1.8.24
|
133
|
+
signing_key:
|
134
|
+
specification_version: 3
|
135
|
+
summary: Add Ember assets to a Middleman project. Support for production version of
|
136
|
+
Ember when building.
|
137
|
+
test_files: []
|