pupu 0.1.pre → 0.1
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 +9 -0
- data/CHANGELOG +23 -4
- data/Gemfile +9 -0
- data/LICENSE +1 -1
- data/README.textile +3 -3
- data/TODO.txt +8 -3
- data/bin/pupu +19 -24
- data/examples/merb/.gitignore +17 -0
- data/examples/merb/Gemfile +27 -0
- data/examples/merb/README.textile +3 -5
- data/examples/merb/Rakefile +3 -3
- data/examples/merb/config/framework.rb +4 -4
- data/examples/merb/config/init.rb +7 -0
- data/examples/merb/public/pupu/autocompleter/.gitignore +5 -0
- data/examples/merb/public/pupu/autocompleter/README.textile +2 -2
- data/examples/merb/public/pupu/autocompleter/config.rb +1 -1
- data/examples/merb/public/pupu/blueprint/.gitignore +5 -0
- data/examples/merb/public/pupu/blueprint/config.rb +7 -7
- data/examples/merb/public/pupu/flash/.gitignore +5 -0
- data/examples/merb/public/pupu/flash/config.rb +1 -1
- data/examples/merb/public/pupu/lighter/.gitignore +10 -0
- data/examples/merb/public/pupu/lighter/config.rb +2 -2
- data/{spec/pupu/adapters/merb_spec.rb → examples/merb/public/pupu/lighter/images/.gitignore} +0 -0
- data/examples/merb/public/pupu/mootools/.gitignore +5 -0
- data/examples/merb/public/pupu/mootools/README.textile +1 -1
- data/examples/merb/public/pupu/mootools/config.rb +1 -1
- data/examples/rails/.gitignore +7 -0
- data/examples/rails/Gemfile +28 -0
- data/examples/rails/README.textile +5 -0
- data/examples/rails/Rakefile +10 -0
- data/examples/rails/app/controllers/application_controller.rb +10 -0
- data/examples/rails/app/controllers/home_controller.rb +8 -0
- data/examples/rails/app/helpers/application_helper.rb +3 -0
- data/{spec/pupu/adapters/rango_spec.rb → examples/rails/app/views/examples/arguments.html.erb} +0 -0
- data/examples/rails/app/views/examples/dependencies.html.erb +0 -0
- data/examples/rails/app/views/examples/simple.html.erb +4 -0
- data/examples/rails/app/views/index.html.erb +7 -0
- data/examples/rails/app/views/layout.html.erb +12 -0
- data/examples/rails/config/boot.rb +110 -0
- data/examples/rails/config/environment.rb +55 -0
- data/examples/rails/config/environments/development.rb +17 -0
- data/examples/rails/config/environments/production.rb +28 -0
- data/examples/rails/config/environments/test.rb +28 -0
- data/examples/rails/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/rails/config/initializers/inflections.rb +10 -0
- data/examples/rails/config/initializers/mime_types.rb +5 -0
- data/examples/rails/config/initializers/new_rails_defaults.rb +21 -0
- data/examples/rails/config/initializers/session_store.rb +15 -0
- data/examples/rails/config/routes.rb +43 -0
- data/examples/rails/db/seeds.rb +7 -0
- data/examples/rails/public/404.html +30 -0
- data/examples/rails/public/422.html +30 -0
- data/examples/rails/public/500.html +30 -0
- data/examples/rails/public/favicon.ico +0 -0
- data/examples/rails/public/robots.txt +5 -0
- data/examples/rails/script/about +4 -0
- data/examples/rails/script/console +3 -0
- data/examples/rails/script/dbconsole +3 -0
- data/examples/rails/script/destroy +3 -0
- data/examples/rails/script/generate +3 -0
- data/examples/rails/script/performance/benchmarker +3 -0
- data/examples/rails/script/performance/profiler +3 -0
- data/examples/rails/script/plugin +3 -0
- data/examples/rails/script/runner +3 -0
- data/examples/rails/script/server +3 -0
- data/examples/rails/spec/application_spec.rb +37 -0
- data/examples/rails/spec/spec_helper.rb +0 -0
- data/examples/rango/.gitignore +4 -0
- data/examples/rango/Gemfile +56 -0
- data/examples/rango/README.textile +4 -6
- data/examples/rango/init.rb +7 -0
- data/examples/rango/media/pupu/autocompleter/.gitignore +5 -0
- data/examples/rango/media/pupu/autocompleter/README.textile +2 -2
- data/examples/rango/media/pupu/autocompleter/config.rb +1 -1
- data/examples/rango/media/pupu/blueprint/.gitignore +5 -0
- data/examples/rango/media/pupu/blueprint/config.rb +7 -7
- data/examples/rango/media/pupu/flash/.gitignore +5 -0
- data/examples/rango/media/pupu/flash/config.rb +1 -1
- data/examples/rango/media/pupu/lighter/.gitignore +10 -0
- data/examples/rango/media/pupu/lighter/config.rb +2 -2
- data/examples/rango/media/pupu/lighter/images/.gitignore +0 -0
- data/examples/rango/media/pupu/mootools/.gitignore +5 -0
- data/examples/rango/media/pupu/mootools/README.textile +1 -1
- data/examples/rango/media/pupu/mootools/config.rb +1 -1
- data/gems/cache/media-path-0.1.2.gem +0 -0
- data/gems/cache/nake-0.0.8.gem +0 -0
- data/gems/cache/rspec-1.3.0.gem +0 -0
- data/gems/cache/term-ansicolor-1.0.4.gem +0 -0
- data/lib/pupu.rb +2 -1
- data/lib/pupu/adapters/merb.rb +12 -0
- data/lib/pupu/adapters/rails.rb +12 -0
- data/lib/pupu/adapters/rango.rb +25 -3
- data/lib/pupu/cli.rb +13 -11
- data/lib/pupu/dsl.rb +34 -13
- data/lib/pupu/exceptions.rb +5 -0
- data/lib/pupu/github.rb +26 -14
- data/lib/pupu/helpers.rb +8 -2
- data/lib/pupu/metadata.rb +2 -0
- data/lib/pupu/parser.rb +19 -4
- data/lib/pupu/pupu.rb +53 -27
- data/lib/pupu/tasks/pupu.nake +52 -0
- data/lib/pupu/version.rb +1 -3
- data/pupu.gemspec +15 -7
- data/pupu.pre.gemspec +5 -33
- data/spec/data/public/pupu/autocompleter/.gitignore +5 -0
- data/spec/data/public/pupu/autocompleter/README.textile +2 -2
- data/spec/data/public/pupu/autocompleter/config.rb +3 -1
- data/spec/pupu/dsl_spec.rb +3 -0
- data/spec/pupu/exceptions_spec.rb +3 -0
- data/spec/pupu/github_spec.rb +4 -1
- data/spec/pupu/helpers_spec.rb +5 -2
- data/spec/pupu/metadata_spec.rb +3 -0
- data/spec/pupu/parser_spec.rb +4 -1
- data/spec/pupu/pupu_spec.rb +3 -0
- data/stubs/pupu/content/%name%.gemspec.rbt +47 -0
- data/stubs/pupu/content/%name%.pre.gemspec.rbt +8 -0
- data/stubs/pupu/content/.gitignore +12 -0
- data/stubs/pupu/content/config.rb.rbt +3 -1
- data/stubs/pupu/content/deps.rip +5 -0
- data/stubs/pupu/content/images/.gitignore +0 -0
- data/stubs/pupu/content/init.rb.rbt +17 -0
- data/stubs/pupu/content/lib/%name%.rb.rbt +4 -0
- data/stubs/pupu/content/lib/%name%/adapters/rails.rb +0 -0
- data/stubs/pupu/content/lib/%name%/adapters/rango.rb +0 -0
- data/stubs/pupu/content/spec/%name%/.gitignore +0 -0
- data/stubs/pupu/content/spec/%name%_spec.rb.rbt +10 -0
- data/stubs/pupu/content/spec/spec.opts +5 -0
- data/stubs/pupu/content/spec/spec_helper.rb.rbt +7 -0
- data/stubs/pupu/postprocess.rb +8 -0
- data/stubs/pupu/setup.rb +4 -0
- data/tasks.rb +37 -0
- metadata +284 -200
- data/Rakefile +0 -28
- data/script/spec +0 -14
- data/tasks/benchmark.rake +0 -11
- data/tasks/gem.rake +0 -23
- data/tasks/hooks.rake +0 -12
- data/tasks/release.rake +0 -68
- data/tasks/spec.rake +0 -27
- data/tasks/submodules.rake +0 -33
- data/tasks/yardoc.rake +0 -9
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
autoload "Pupu", "pupu/cli"
|
|
4
|
+
|
|
5
|
+
# == Setup ==
|
|
6
|
+
# task "pupu:setup" => :environment
|
|
7
|
+
Task.new("pupu:setup") do |task|
|
|
8
|
+
task.hidden = true
|
|
9
|
+
task.define do
|
|
10
|
+
require "pupu/cli"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Task.new("pupu:install") do |task|
|
|
15
|
+
task.description = "Install given packages"
|
|
16
|
+
task.dependencies << "pupu:setup"
|
|
17
|
+
task.define do |*names|
|
|
18
|
+
Pupu::CLI.install(*names)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
Task.new("pupu:uninstall") do |task|
|
|
23
|
+
task.description = "Uninstall given packages"
|
|
24
|
+
task.dependencies << "pupu:setup"
|
|
25
|
+
task.define do |*names|
|
|
26
|
+
Pupu::CLI.uninstall(*names)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
Task.new("pupu:update") do |task|
|
|
31
|
+
task.description = "Update given packages. If no name is given, update all of them."
|
|
32
|
+
task.dependencies << "pupu:setup"
|
|
33
|
+
task.define do |*names|
|
|
34
|
+
Pupu::CLI.update(*names)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
Task.new("pupu:list") do |task|
|
|
39
|
+
task.description = "List all installed packages."
|
|
40
|
+
task.dependencies << "pupu:setup"
|
|
41
|
+
task.define do
|
|
42
|
+
Pupu::CLI.list
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
Task.new("pupu:search") do |task|
|
|
47
|
+
task.description = "Search pupu matching given pattern on GitHub"
|
|
48
|
+
task.dependencies << "pupu:setup"
|
|
49
|
+
task.define do |pattern|
|
|
50
|
+
Pupu::CLI.search(pattern)
|
|
51
|
+
end
|
|
52
|
+
end
|
data/lib/pupu/version.rb
CHANGED
data/pupu.gemspec
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env gem build
|
|
2
2
|
# encoding: utf-8
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require "pupu/version"
|
|
4
|
+
require "base64"
|
|
5
|
+
require File.join(File.dirname(__FILE__), "lib/pupu/version")
|
|
7
6
|
|
|
8
7
|
Gem::Specification.new do |s|
|
|
9
8
|
s.name = "pupu"
|
|
@@ -13,11 +12,12 @@ Gem::Specification.new do |s|
|
|
|
13
12
|
s.summary = "Framework-agnostic package system for media files"
|
|
14
13
|
s.description = "Pupu is a plugin system for media like mootools plugins, icon sets etc. It knows dependencies and it has CLI interface, so it's really easy to bundle such pupus into your app."
|
|
15
14
|
s.cert_chain = nil
|
|
16
|
-
s.email =
|
|
15
|
+
s.email = Base64.decode64("c3Rhc3RueUAxMDFpZGVhcy5jeg==\n")
|
|
17
16
|
|
|
18
17
|
# files
|
|
19
|
-
s.files =
|
|
20
|
-
|
|
18
|
+
s.files = `git ls-files`.split("\n")
|
|
19
|
+
|
|
20
|
+
s.executables = Dir["bin/*"].map(&File.method(:basename))
|
|
21
21
|
s.default_executable = "pupu"
|
|
22
22
|
s.require_paths = ["lib"]
|
|
23
23
|
|
|
@@ -31,6 +31,14 @@ Gem::Specification.new do |s|
|
|
|
31
31
|
# use gem install pupu --development if you want to install them
|
|
32
32
|
s.add_development_dependency "simple-templater"
|
|
33
33
|
|
|
34
|
+
begin
|
|
35
|
+
require "changelog"
|
|
36
|
+
rescue LoadError
|
|
37
|
+
warn "You have to have changelog gem installed for post install message"
|
|
38
|
+
else
|
|
39
|
+
s.post_install_message = CHANGELOG.new.version_changes
|
|
40
|
+
end
|
|
41
|
+
|
|
34
42
|
# RubyForge
|
|
35
43
|
s.rubyforge_project = "pupu"
|
|
36
44
|
end
|
data/pupu.pre.gemspec
CHANGED
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env gem build
|
|
2
2
|
# encoding: utf-8
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Gem::Specification.new do |s|
|
|
9
|
-
s.name = "pupu"
|
|
10
|
-
s.version = '0.1.pre'
|
|
11
|
-
s.authors = ["Jakub Šťastný aka Botanicus"]
|
|
12
|
-
s.homepage = "http://github.com/botanicus/pupu"
|
|
13
|
-
s.summary = "Framework-agnostic package system for media files"
|
|
14
|
-
s.description = "Pupu is a plugin system for media like mootools plugins, icon sets etc. It knows dependencies and it has CLI interface, so it's really easy to bundle such pupus into your app."
|
|
15
|
-
s.cert_chain = nil
|
|
16
|
-
s.email = ["knava.bestvinensis", "gmail.com"].join("@")
|
|
17
|
-
|
|
18
|
-
# files
|
|
19
|
-
s.files = Dir.glob("**/*") - Dir.glob("pkg/*")
|
|
20
|
-
s.executables = ["pupu"]
|
|
21
|
-
s.default_executable = "pupu"
|
|
22
|
-
s.require_paths = ["lib"]
|
|
23
|
-
|
|
24
|
-
# Ruby version
|
|
25
|
-
s.required_ruby_version = ::Gem::Requirement.new("~> 1.9.1")
|
|
26
|
-
|
|
27
|
-
# runtime dependencies
|
|
28
|
-
s.add_dependency "media-path"
|
|
29
|
-
|
|
30
|
-
# development dependencies
|
|
31
|
-
# use gem install pupu --development if you want to install them
|
|
32
|
-
s.add_development_dependency "simple-templater"
|
|
33
|
-
|
|
34
|
-
# RubyForge
|
|
35
|
-
s.rubyforge_project = "pupu"
|
|
4
|
+
# You might think this is a terrible mess and guess what, you're
|
|
5
|
+
# right mate! However say thanks to authors of RubyGems, not me.
|
|
6
|
+
eval(File.read("pupu.gemspec")).tap do |specification|
|
|
7
|
+
specification.version = "#{specification.version}.pre"
|
|
36
8
|
end
|
|
@@ -19,8 +19,8 @@ h2. Layout
|
|
|
19
19
|
plugin :autocompleter
|
|
20
20
|
|
|
21
21
|
# for local requests through Autocompleter.Request class
|
|
22
|
-
plugin :autocompleter, :
|
|
22
|
+
plugin :autocompleter, type: "local"
|
|
23
23
|
|
|
24
24
|
# for ajax requests through Autocompleter.Request class
|
|
25
|
-
plugin :autocompleter, :
|
|
25
|
+
plugin :autocompleter, type: "request"
|
|
26
26
|
</pre>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
1
3
|
# autocompleter depends on mootools
|
|
2
4
|
dependencies :mootools
|
|
3
5
|
|
|
@@ -7,6 +9,6 @@ javascripts "observer", "autocompleter"
|
|
|
7
9
|
# stylesheet
|
|
8
10
|
stylesheet "autocompleter"
|
|
9
11
|
|
|
10
|
-
parameter :type, :
|
|
12
|
+
parameter :type, optional: ["local", "request"] do |type|
|
|
11
13
|
javascript "autocompleter.#{type}"
|
|
12
14
|
end
|
data/spec/pupu/dsl_spec.rb
CHANGED
data/spec/pupu/github_spec.rb
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
1
3
|
require_relative "../spec_helper"
|
|
4
|
+
|
|
2
5
|
require "pupu/github"
|
|
3
6
|
|
|
4
7
|
# TODO
|
|
@@ -13,7 +16,7 @@ describe Pupu::GitHub do
|
|
|
13
16
|
end
|
|
14
17
|
|
|
15
18
|
it "should return nil if plugin do not exists" do
|
|
16
|
-
plugin(:autocompleter, :
|
|
19
|
+
plugin(:autocompleter, request: "local")
|
|
17
20
|
end
|
|
18
21
|
end
|
|
19
22
|
end
|
data/spec/pupu/helpers_spec.rb
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
1
3
|
require_relative "../spec_helper"
|
|
4
|
+
|
|
2
5
|
require "pupu/pupu"
|
|
3
6
|
require "pupu/helpers"
|
|
4
|
-
include Pupu::Helpers
|
|
5
7
|
|
|
6
8
|
describe "Helpers#pupu" do
|
|
9
|
+
include Pupu::Helpers
|
|
7
10
|
before(:each) do
|
|
8
11
|
Pupu.root = File.dirname(__FILE__) + "/data/root/pupu"
|
|
9
12
|
end
|
|
@@ -13,6 +16,6 @@ describe "Helpers#pupu" do
|
|
|
13
16
|
end
|
|
14
17
|
|
|
15
18
|
it "should return text with assets" do
|
|
16
|
-
pupu(:autocompleter, :
|
|
19
|
+
pupu(:autocompleter, type: "local").should eql(Parser.new(:autocompleter, type: "local").parse!)
|
|
17
20
|
end
|
|
18
21
|
end
|
data/spec/pupu/metadata_spec.rb
CHANGED
data/spec/pupu/parser_spec.rb
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
1
3
|
require_relative "../spec_helper"
|
|
4
|
+
|
|
2
5
|
require "pupu/parser"
|
|
3
6
|
|
|
4
7
|
# TODO
|
|
@@ -13,7 +16,7 @@ describe Pupu::Parser do
|
|
|
13
16
|
end
|
|
14
17
|
|
|
15
18
|
it "should return nil if plugin do not exists" do
|
|
16
|
-
plugin(:autocompleter, :
|
|
19
|
+
plugin(:autocompleter, request: "local")
|
|
17
20
|
end
|
|
18
21
|
end
|
|
19
22
|
end
|
data/spec/pupu/pupu_spec.rb
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env gem build
|
|
2
|
+
# encoding: utf-8
|
|
3
|
+
|
|
4
|
+
# Run ./<%= @name %>.gemspec or gem build <%= @name %>.gemspec
|
|
5
|
+
# NOTE: we can't use require_relative because when we run gem build, it use eval for executing this file
|
|
6
|
+
require File.join(File.dirname(__FILE__), "lib", "<%= @name %>", "version")
|
|
7
|
+
require "base64"
|
|
8
|
+
|
|
9
|
+
Gem::Specification.new do |s|
|
|
10
|
+
s.name = "<%= @name %>"
|
|
11
|
+
s.version = <%= @constant %>::VERSION
|
|
12
|
+
s.authors = ["<%= @full_name %>"]
|
|
13
|
+
s.homepage = "http://github.com/<%= @github_user %>/<%= @github_repository %>"
|
|
14
|
+
s.summary = "" # TODO: summary
|
|
15
|
+
s.description = "" # TODO: long description
|
|
16
|
+
s.cert_chain = nil
|
|
17
|
+
s.email = Base64.decode64() # TODO: your encrypted e-mail
|
|
18
|
+
s.has_rdoc = true
|
|
19
|
+
|
|
20
|
+
# files
|
|
21
|
+
s.files = `git ls-files`.split("\n")
|
|
22
|
+
|
|
23
|
+
s.executables = Dir["bin/*"].map(&File.method(:basename))
|
|
24
|
+
s.default_executable = "<%= @name %>"
|
|
25
|
+
s.require_paths = ["lib"]
|
|
26
|
+
|
|
27
|
+
# Ruby version
|
|
28
|
+
s.required_ruby_version = ::Gem::Requirement.new(">= 1.9")
|
|
29
|
+
|
|
30
|
+
# runtime dependencies
|
|
31
|
+
# s.add_dependency "my-gem"
|
|
32
|
+
|
|
33
|
+
# development dependencies
|
|
34
|
+
# use gem install <%= @name %> --development if you want to install them
|
|
35
|
+
# s.add_development_dependency "simple-templater"
|
|
36
|
+
|
|
37
|
+
begin
|
|
38
|
+
require "changelog"
|
|
39
|
+
rescue LoadError
|
|
40
|
+
warn "You have to have changelog gem installed for post install message"
|
|
41
|
+
else
|
|
42
|
+
s.post_install_message = CHANGELOG.new.version_changes
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# RubyForge
|
|
46
|
+
s.rubyforge_project = "<%= @name %>"
|
|
47
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env gem build
|
|
2
|
+
# encoding: utf-8
|
|
3
|
+
|
|
4
|
+
# You might think this is a terrible mess and guess what, you're
|
|
5
|
+
# right mate! However say thanks to authors of RubyGems, not me.
|
|
6
|
+
eval(File.read("<%= @name %>.gemspec")).tap do |specification|
|
|
7
|
+
specification.version = "#{specification.version}.pre"
|
|
8
|
+
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
1
3
|
# dependencies of the pupu
|
|
2
4
|
<% @dependencies.each do |dependency| %>
|
|
3
5
|
dependency :<%= dependency %>
|
|
@@ -15,6 +17,6 @@ stylesheet "<%= stylesheet %>"
|
|
|
15
17
|
|
|
16
18
|
# parameters of plugin
|
|
17
19
|
# it will be blank in most cases
|
|
18
|
-
#parameter :request, :
|
|
20
|
+
#parameter :request, optional: ["local", "ajax"] do |type|
|
|
19
21
|
# javascript "lib/autocompleter.#{type}"
|
|
20
22
|
#end
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
# This file will be loaded automatically when the pupu helper is used
|
|
4
|
+
# If you don't want to load this file, use pupu :whatever, helpers: false
|
|
5
|
+
|
|
6
|
+
$LOAD_PATH.unshift(File.expand_path("lib", __FILE__))
|
|
7
|
+
|
|
8
|
+
begin
|
|
9
|
+
require "<%= @name %>/adapters/#{Pupu.framework}"
|
|
10
|
+
rescue LoadError
|
|
11
|
+
# If you don't have adapter file, everything should work anyway since Pupu::Helpers
|
|
12
|
+
# mixin is included into helper module of your framework, so we can fail silently
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
module Pupu::Helpers
|
|
16
|
+
include <%= @constant %>::Helpers
|
|
17
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/stubs/pupu/postprocess.rb
CHANGED
|
@@ -8,4 +8,12 @@ require "simple-templater/hooks/postprocess/git_repository"
|
|
|
8
8
|
hook do |generator, context|
|
|
9
9
|
# simple-templater create rango --full-name="Jakub Stastny"
|
|
10
10
|
generator.after Hooks::GitRepository
|
|
11
|
+
|
|
12
|
+
unless context[:ruby]
|
|
13
|
+
rm "init.rb"
|
|
14
|
+
rm "deps.rb"
|
|
15
|
+
rm "#{context[:name]}.gemspec"
|
|
16
|
+
rm "#{context[:name]}.pre.gemspec"
|
|
17
|
+
rm_r "lib"
|
|
18
|
+
end
|
|
11
19
|
end
|
data/stubs/pupu/setup.rb
CHANGED
|
@@ -10,6 +10,7 @@ require "simple-templater/hooks/preprocess/full_name"
|
|
|
10
10
|
# --javascripts=mootools-core,mootools-more | --no-javascripts
|
|
11
11
|
# --stylesheets=one,two | --no-stylesheets
|
|
12
12
|
# --dependencies=mootools,blueprint | --no-dependencies
|
|
13
|
+
# --ruby || --no-ruby
|
|
13
14
|
hook do |generator, context|
|
|
14
15
|
generator.before Hooks::FullName, Hooks::GithubUser
|
|
15
16
|
generator.target = "pupu-#{context[:name]}" unless generator.target.match(/^pupu-/) # this is the convention
|
|
@@ -22,4 +23,7 @@ hook do |generator, context|
|
|
|
22
23
|
unless context[:github_repository] && context[:github_repository].match(/^pupu-/)
|
|
23
24
|
context[:github_repository] = "pupu-#{context[:github_repository]}"
|
|
24
25
|
end
|
|
26
|
+
if context[:ruby]
|
|
27
|
+
context[:constant] = context[:name].camel_case
|
|
28
|
+
end
|
|
25
29
|
end
|