wallpapering-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +34 -0
- data/Rakefile +1 -0
- data/lib/generators/wallpapering/decorator_generator.rb +24 -0
- data/lib/generators/wallpapering/templates/app/decorators/%filename%.rb.tt +2 -0
- data/lib/wallpapering-rails.rb +7 -0
- data/lib/wallpapering-rails/version.rb +5 -0
- data/spec/lib/generators/wallpapering-rails/decorator_generator_spec.rb +29 -0
- data/wallpapering-rails.gemspec +24 -0
- metadata +122 -0
data/.gitignore
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3-p362
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Matt House
|
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,34 @@
|
|
1
|
+
# Wallpapering::Rails
|
2
|
+
|
3
|
+
Wallpapering integration for Rails.
|
4
|
+
|
5
|
+
Wallpapering is a decorator pattern implementation in Ruby
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'wallpapering-rails'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
`wallpapering-rails` provides a generator for rails to build your own generators.
|
20
|
+
|
21
|
+
Just run `rails g wallpapering:decorator <decorator name>`. Where `<decorator name>` is underscored or hyphenated. eg
|
22
|
+
|
23
|
+
$ rails g wallpapering:decorator with_sugar
|
24
|
+
# generates app/decorators/with_sugar.rb => class WithSugar < Wallpapering::Decorator
|
25
|
+
|
26
|
+
`wallpapering-rails` assumes that you want your decorators to live in `app/decorators`
|
27
|
+
|
28
|
+
## Contributing
|
29
|
+
|
30
|
+
1. Fork it
|
31
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
32
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
33
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
34
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Wallpapering
|
2
|
+
class DecoratorGenerator < ::Rails::Generators::Base
|
3
|
+
desc "generate a wallpaper generator"
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
|
6
|
+
argument :decorator_name, :type => :string
|
7
|
+
|
8
|
+
def create_decorator
|
9
|
+
directory "app"
|
10
|
+
end
|
11
|
+
|
12
|
+
def filename
|
13
|
+
decorator_name.
|
14
|
+
downcase.
|
15
|
+
underscore
|
16
|
+
end
|
17
|
+
|
18
|
+
def class_name
|
19
|
+
decorator_name.
|
20
|
+
underscore.
|
21
|
+
camelize
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "rails/all"
|
2
|
+
require "rails/generators"
|
3
|
+
require "generator_spec/test_case"
|
4
|
+
|
5
|
+
require_relative "../../../../lib/generators/wallpapering/decorator_generator"
|
6
|
+
|
7
|
+
module Wallpapering
|
8
|
+
describe DecoratorGenerator do
|
9
|
+
include GeneratorSpec::TestCase
|
10
|
+
|
11
|
+
destination File.expand_path("generator_specs", '/tmp')
|
12
|
+
|
13
|
+
arguments ["with-kittens"]
|
14
|
+
|
15
|
+
before do
|
16
|
+
prepare_destination
|
17
|
+
run_generator
|
18
|
+
end
|
19
|
+
|
20
|
+
it "creates the app/decorators directory" do
|
21
|
+
assert_directory "app/decorators"
|
22
|
+
end
|
23
|
+
|
24
|
+
it "creates the named decorator" do
|
25
|
+
assert_file "app/decorators/with_kittens.rb",
|
26
|
+
"class WithKittens < Wallpapering::Decorator\nend\n"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'wallpapering-rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "wallpapering-rails"
|
8
|
+
gem.version = Wallpapering::Rails::VERSION
|
9
|
+
gem.authors = ["Matt House"]
|
10
|
+
gem.email = ["matt@eightbitraptor.com"]
|
11
|
+
gem.description = %q{A simple decorator pattern implementation for Rails}
|
12
|
+
gem.summary = %q{wraps the wallpapering gem for Rails}
|
13
|
+
gem.homepage = "http://github.com/eightbitraptor/wallpapering-rails"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency "wallpapering"
|
21
|
+
gem.add_dependency "rails"
|
22
|
+
gem.add_development_dependency "rspec"
|
23
|
+
gem.add_development_dependency "generator_spec"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wallpapering-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matt House
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: wallpapering
|
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: rails
|
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: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
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: generator_spec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
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: '0'
|
78
|
+
description: A simple decorator pattern implementation for Rails
|
79
|
+
email:
|
80
|
+
- matt@eightbitraptor.com
|
81
|
+
executables: []
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files: []
|
84
|
+
files:
|
85
|
+
- .gitignore
|
86
|
+
- .ruby-version
|
87
|
+
- Gemfile
|
88
|
+
- LICENSE.txt
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- lib/generators/wallpapering/decorator_generator.rb
|
92
|
+
- lib/generators/wallpapering/templates/app/decorators/%filename%.rb.tt
|
93
|
+
- lib/wallpapering-rails.rb
|
94
|
+
- lib/wallpapering-rails/version.rb
|
95
|
+
- spec/lib/generators/wallpapering-rails/decorator_generator_spec.rb
|
96
|
+
- wallpapering-rails.gemspec
|
97
|
+
homepage: http://github.com/eightbitraptor/wallpapering-rails
|
98
|
+
licenses: []
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ! '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ! '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
requirements: []
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 1.8.24
|
118
|
+
signing_key:
|
119
|
+
specification_version: 3
|
120
|
+
summary: wraps the wallpapering gem for Rails
|
121
|
+
test_files:
|
122
|
+
- spec/lib/generators/wallpapering-rails/decorator_generator_spec.rb
|