pupu 0.1.pre → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/Rakefile
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require_relative "lib/pupu/version"
|
4
|
-
|
5
|
-
# ENV setup for external commands
|
6
|
-
ENV["RUBYLIB"] = Dir["vendor/*/lib"].join(":")
|
7
|
-
$LOAD_PATH.clear.push(*Dir["vendor/*/lib"])
|
8
|
-
|
9
|
-
# encoding
|
10
|
-
Encoding.default_internal = "utf-8"
|
11
|
-
Encoding.default_external = "utf-8"
|
12
|
-
|
13
|
-
# http://support.runcoderun.com/faqs/builds/how-do-i-run-rake-with-trace-enabled
|
14
|
-
Rake.application.options.trace = true
|
15
|
-
|
16
|
-
# default task for RunCodeRun.com
|
17
|
-
task :default => ["submodules:init", :spec]
|
18
|
-
|
19
|
-
# load tasks
|
20
|
-
Dir["tasks/*.rake"].each do |taskfile|
|
21
|
-
begin
|
22
|
-
load File.join(Dir.pwd, taskfile)
|
23
|
-
rescue Exception => exception
|
24
|
-
puts "Exception #{exception.class} occured during loading #{taskfile}:"
|
25
|
-
puts exception.message
|
26
|
-
puts exception.backtrace
|
27
|
-
end
|
28
|
-
end
|
data/script/spec
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby1.9
|
2
|
-
# encoding: utf-8
|
3
|
-
|
4
|
-
Dir[File.join(File.dirname(__FILE__), "..", "vendor", "*")].each do |path|
|
5
|
-
if File.directory?(path) && Dir["#{path}/*"].empty?
|
6
|
-
warn "Dependency #{File.basename(path)} in vendor seems to be empty. Run git submodule init && git submodule update to checkout it."
|
7
|
-
elsif File.directory?(path) && File.directory?(File.join(path, "lib"))
|
8
|
-
$:.unshift File.join(path, "lib")
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
ARGV.push("spec") if ARGV.empty?
|
13
|
-
|
14
|
-
load File.expand_path(File.join(File.dirname(__FILE__), "..", "vendor", "rspec", "bin", "spec"))
|
data/tasks/benchmark.rake
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# http://github.com/somebee/rbench/tree/master
|
4
|
-
desc "Run all benchmarks"
|
5
|
-
task :bm do
|
6
|
-
abort "Benchmarks doesn't work at the moment"
|
7
|
-
require "rbench"
|
8
|
-
Dir["#{Dir.pwd}/benchmarks/bm/*.rb"].each do |benchmark|
|
9
|
-
load benchmark
|
10
|
-
end
|
11
|
-
end
|
data/tasks/gem.rake
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
desc "Build the gem"
|
4
|
-
task :build do
|
5
|
-
sh "gem build pupu.gemspec"
|
6
|
-
end
|
7
|
-
|
8
|
-
namespace :build do
|
9
|
-
desc "Build the prerelease gem"
|
10
|
-
task :prerelease do
|
11
|
-
gemspec = "pupu.gemspec"
|
12
|
-
content = File.read(gemspec)
|
13
|
-
prename = "#{gemspec.split(".").first}.pre.gemspec"
|
14
|
-
# 0.1.1 => 0.2
|
15
|
-
version = Pupu::VERSION.sub(/^(\d+)\.(\d+).*$/) { "#$1.#{$2.to_i + 1}" }
|
16
|
-
puts "Current #{Pupu::VERSION} => #{version} pre"
|
17
|
-
File.open(prename, "w") do |file|
|
18
|
-
file.puts(content.gsub(/(\w+::VERSION)/, "'#{version}.pre'"))
|
19
|
-
end
|
20
|
-
sh "gem build #{prename}"
|
21
|
-
rm prename
|
22
|
-
end
|
23
|
-
end
|
data/tasks/hooks.rake
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
desc "Install Git hooks"
|
4
|
-
task :hooks do
|
5
|
-
if Dir.exist?(".git/hooks")
|
6
|
-
abort "You must remove .git/hooks first"
|
7
|
-
else
|
8
|
-
# do not symlink them, otherwise git will add samples
|
9
|
-
# FIXME: permissions
|
10
|
-
cp_r "support/hooks", ".git/hooks"
|
11
|
-
end
|
12
|
-
end
|
data/tasks/release.rake
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
desc "Release new version of pupu"
|
4
|
-
task release: ["deps.rip", "version:increase", "release:tag", "release:gemcutter"]
|
5
|
-
|
6
|
-
namespace :version do
|
7
|
-
task :increase do
|
8
|
-
puts "Which version are you just releasing (previous version is #{Pupu::VERSION})"
|
9
|
-
version = STDIN.gets.chomp
|
10
|
-
File.open("lib/pupu/version.rb", "w") do |file|
|
11
|
-
file.puts <<-EOF
|
12
|
-
# encoding: utf-8
|
13
|
-
|
14
|
-
# NOTE: Do not edit this file manually, this
|
15
|
-
# file is regenerated by task rake version:increase
|
16
|
-
module Pupu
|
17
|
-
VERSION ||= "#{version}"
|
18
|
-
end
|
19
|
-
EOF
|
20
|
-
end
|
21
|
-
|
22
|
-
Pupu.const_set("VERSION", version) # so other release tasks will work
|
23
|
-
sh "git commit lib/pupu/version.rb -m 'Increased version to #{version}'"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
namespace :release do
|
28
|
-
desc "Create Git tag"
|
29
|
-
task :tag do
|
30
|
-
puts "Creating new git tag #{Pupu::VERSION} and pushing it online ..."
|
31
|
-
sh "git tag -a -m 'Version #{Pupu::VERSION}' #{Pupu::VERSION}"
|
32
|
-
sh "git push --tags"
|
33
|
-
puts "Tag #{Pupu::VERSION} was created and pushed to GitHub."
|
34
|
-
end
|
35
|
-
|
36
|
-
desc "Push gem to Gemcutter"
|
37
|
-
task :gemcutter => :build do
|
38
|
-
puts "Pushing to Gemcutter ..."
|
39
|
-
sh "gem push #{Dir["*.gem"].last}"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
desc "Create and push prerelease gem"
|
44
|
-
task :prerelease => "build:prerelease" do
|
45
|
-
puts "Pushing to Gemcutter ..."
|
46
|
-
sh "gem push #{Dir["*.pre.gem"].last}"
|
47
|
-
end
|
48
|
-
|
49
|
-
dependencies = FileList["vendor/*/.git"].sub(/\/\.git$/, "")
|
50
|
-
|
51
|
-
desc "Regenerate deps.rip"
|
52
|
-
file "deps.rip" => dependencies do
|
53
|
-
commits = Hash.new
|
54
|
-
commits = dependencies.inject(Hash.new) do |hash, path|
|
55
|
-
Dir.chdir(path) do
|
56
|
-
revision = %x(git show | head -1).chomp.sub("commit ", "")
|
57
|
-
hash[File.basename(path)] = revision
|
58
|
-
hash
|
59
|
-
end
|
60
|
-
end
|
61
|
-
template = File.read("deps.rip.rbe")
|
62
|
-
deps_rip = eval("%Q{#{template}}")
|
63
|
-
File.open("deps.rip", "w") do |file|
|
64
|
-
file.puts(deps_rip)
|
65
|
-
end
|
66
|
-
sh "chmod +x deps.rip"
|
67
|
-
sh "git commit deps.rip -m 'Updated deps.rip'"
|
68
|
-
end
|
data/tasks/spec.rake
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
desc "Run specs"
|
4
|
-
task :spec, :path do |task, args|
|
5
|
-
exec "./script/spec --options spec/spec.opts #{args.path || "spec"}"
|
6
|
-
end
|
7
|
-
|
8
|
-
desc "Create stubs of all library files."
|
9
|
-
task "spec:stubs" do
|
10
|
-
Dir.glob("lib/**/*.rb").each do |file|
|
11
|
-
specfile = file.sub(/^lib/, "spec").sub(/\.rb$/, '_spec.rb')
|
12
|
-
unless File.exist?(specfile)
|
13
|
-
%x[mkdir -p #{File.dirname(specfile)}]
|
14
|
-
%x[touch #{specfile}]
|
15
|
-
puts "Created #{specfile}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
(Dir.glob("spec/pupu/**/*.rb") + ["spec/pupu_spec.rb"]).each do |file|
|
19
|
-
libfile = file.sub(/spec/, "lib").sub(/_spec\.rb$/, '.rb')
|
20
|
-
if !File.exist?(libfile) && File.zero?(file)
|
21
|
-
%x[rm #{file}]
|
22
|
-
puts "Removed empty file #{file}"
|
23
|
-
elsif !File.exist?(libfile)
|
24
|
-
puts "File exists just in spec, not in lib: #{file}"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/tasks/submodules.rake
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# === Helpers === #
|
4
|
-
def submodules(&block)
|
5
|
-
File.foreach(File.join(File.dirname(__FILE__), "..", ".gitmodules")) do |line|
|
6
|
-
if line.match(%r{submodule "(.+)"})
|
7
|
-
block.call($1)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
# === Tasks === #
|
13
|
-
namespace :submodules do
|
14
|
-
desc "Init submodules"
|
15
|
-
task :init do
|
16
|
-
sh "git submodule init"
|
17
|
-
end
|
18
|
-
|
19
|
-
desc "Update submodules"
|
20
|
-
task :update do
|
21
|
-
submodules do |path|
|
22
|
-
if File.directory?(path) && File.directory?(File.join(path, ".git"))
|
23
|
-
Dir.chdir(path) do
|
24
|
-
puts "=> #{path}"
|
25
|
-
sh "git reset --hard"
|
26
|
-
sh "git fetch"
|
27
|
-
sh "git reset origin/master --hard"
|
28
|
-
puts
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/tasks/yardoc.rake
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# template, textile or rdoc or md
|
4
|
-
# -t: template [available: default, javadoc]
|
5
|
-
# -m: markup style used in documentation [available: textile, markdown, rdoc]
|
6
|
-
desc "Generate Yardoc documentation for pupu"
|
7
|
-
task :yardoc do
|
8
|
-
sh "yardoc -r README.textile lib/**/*.rb -t default"
|
9
|
-
end
|