pupu 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
- ---
1
+ ---
2
2
  :revision: d48d57592b62ce7f77fcb7b71d0ddcc4c899933a
3
- :repozitory: git://github.com/botanicus/pupu-autocompleter.git
3
+ :repository: git://github.com/botanicus/pupu-autocompleter.git
4
4
  :dependencies: []
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :revision: 09c6862a75cc4462679d048a1e756fdf913de0c1
3
- :repozitory: git://github.com/botanicus/pupu-blueprint.git
3
+ :repository: git://github.com/botanicus/pupu-blueprint.git
4
4
  :dependencies: []
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :revision: bc43e37af109661e94aa7eeac846c8f6f36a4882
3
- :repozitory: git://github.com/botanicus/pupu-flash.git
3
+ :repository: git://github.com/botanicus/pupu-flash.git
4
4
  :dependencies: []
5
5
 
@@ -1,5 +1,5 @@
1
- ---
1
+ ---
2
2
  :revision: 375395a1490462c30a688729a8ae529a4e7199cf
3
- :repozitory: git://github.com/botanicus/pupu-mootools.git
3
+ :repository: git://github.com/botanicus/pupu-mootools.git
4
4
  :dependencies: []
5
5
 
@@ -1,5 +1,5 @@
1
- ---
1
+ ---
2
2
  :revision: d48d57592b62ce7f77fcb7b71d0ddcc4c899933a
3
- :repozitory: git://github.com/botanicus/pupu-autocompleter.git
3
+ :repository: git://github.com/botanicus/pupu-autocompleter.git
4
4
  :dependencies: []
5
5
 
@@ -1,5 +1,5 @@
1
- ---
1
+ ---
2
2
  :revision: 09c6862a75cc4462679d048a1e756fdf913de0c1
3
- :repozitory: git://github.com/botanicus/pupu-blueprint.git
3
+ :repository: git://github.com/botanicus/pupu-blueprint.git
4
4
  :dependencies: []
5
5
 
@@ -1,5 +1,5 @@
1
- ---
1
+ ---
2
2
  :revision: bc43e37af109661e94aa7eeac846c8f6f36a4882
3
- :repozitory: git://github.com/botanicus/pupu-flash.git
3
+ :repository: git://github.com/botanicus/pupu-flash.git
4
4
  :dependencies: []
5
5
 
@@ -1,5 +1,5 @@
1
- ---
1
+ ---
2
2
  :revision: 375395a1490462c30a688729a8ae529a4e7199cf
3
- :repozitory: git://github.com/botanicus/pupu-mootools.git
3
+ :repository: git://github.com/botanicus/pupu-mootools.git
4
4
  :dependencies: []
5
5
 
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+
3
+ require "ace"
4
+ require "pupu"
5
+ require "pupu/helpers"
6
+
7
+ Pupu.framework = :ace
8
+
9
+ # def Pupu.environment
10
+ # Rails.environment
11
+ # end
12
+
13
+ # def Pupu.logger
14
+ # Rails.logger
15
+ # end
16
+
17
+ Pupu.root = Dir.pwd
18
+ Pupu.media_root = File.join(Pupu.root, "content", "assets")
19
+ Ace::Helpers.send(:include, Pupu::Helpers)
@@ -0,0 +1,27 @@
1
+ # encoding: utf-8
2
+
3
+ require "pupu"
4
+ require "pupu/helpers"
5
+
6
+ # class MyApp < Padrino::Application
7
+ # register Pupu::Helpers
8
+ # end
9
+
10
+ module Pupu::Helpers
11
+ def self.registered(app)
12
+ app.send(:include, self)
13
+ end
14
+ end
15
+
16
+ Pupu.framework = :padrino
17
+
18
+ def Pupu.environment
19
+ Padrino.environment
20
+ end
21
+
22
+ def Pupu.logger
23
+ Padrino.logger
24
+ end
25
+
26
+ Pupu.root = Padrino.root
27
+ Pupu.media_root = File.join(Padrino.root, "public")
@@ -72,7 +72,7 @@ module Pupu
72
72
  end
73
73
 
74
74
  def detect
75
- pupu_dir = Dir["media/pupu", "public/pupu"].first
75
+ pupu_dir = Dir["media/pupu", "public/pupu", "content/assets/pupu"].first
76
76
  path = pupu_dir ? File.expand_path(File.dirname(pupu_dir)) : nil
77
77
  path ||= ["media", "public"].find { |directory| File.directory?(directory) }
78
78
  return if path.nil?
@@ -107,7 +107,8 @@ module Pupu
107
107
  end
108
108
 
109
109
  def update
110
- args = Pupu.all if self.args.empty? # update all if no pupu specified
110
+ args = self.args
111
+ args = Pupu.all if args.empty? # update all if no pupu specified
111
112
  args.each do |pupu|
112
113
  begin
113
114
  GitHub.update(pupu)
@@ -24,7 +24,7 @@ module Pupu
24
24
  @output = Array.new
25
25
  @files = files
26
26
  @dependencies = Array.new
27
- puts "DSL: #{page.inspect}"
27
+ # puts "DSL: #{page.inspect}"
28
28
  @path = pupu.file("config.rb")
29
29
  end
30
30
 
@@ -42,7 +42,7 @@ module Pupu
42
42
  path = pupu.root.to_s # otherwise after we remove the path, we get error at mkdir telling us that the path doesn't exist
43
43
  pupu.metadata # cache metadata
44
44
  FileUtils.rm_r(path)
45
- self.install_files(pupu_name, pupu.metadata.repozitory)
45
+ self.install_files(pupu_name, pupu.metadata.repository)
46
46
  end
47
47
  else
48
48
  Pupu.all.each do |pupu_name|
@@ -63,10 +63,10 @@ module Pupu
63
63
 
64
64
  protected
65
65
  def save_metadata(pupu, url)
66
- revision = %x(git log | head -1).chomp.sub(/^commit /, "")
66
+ revision = %x(git log --pretty=format:'%H' -1)
67
67
  dsl = DSL.new(pupu)
68
68
  dependencies = dsl.get_dependencies.map { |dependency| dependency.name }
69
- params = {revision: revision, repozitory: url, dependencies: dependencies}
69
+ params = {revision: revision, repository: url, dependencies: dependencies}
70
70
  Dir.chdir(@pupu.root.to_s) do
71
71
  File.open("metadata.yml", "w") do |file|
72
72
  file.puts(params.to_yaml)
@@ -19,7 +19,7 @@ module Pupu
19
19
  def initialize(plugin_name, plugin_params, page = Page.new)
20
20
  @plugin = Pupu[plugin_name, plugin_params]
21
21
  @output = Array.new
22
- puts "Parser: #{page.inspect}"
22
+ # puts "Parser: #{page.inspect}"
23
23
  @page = page
24
24
  @dsl = DSL.new(@plugin, page)
25
25
  @@loaded ||= Hash.new
@@ -113,7 +113,8 @@ module Pupu
113
113
  end
114
114
 
115
115
  def root
116
- self.class.root.join(@path)
116
+ # self.class.root.join(@path)
117
+ File.join(self.class.root_path, @path)
117
118
  end
118
119
 
119
120
  def metadata
@@ -121,6 +122,7 @@ module Pupu
121
122
  path = self.file("metadata.yml").path
122
123
  hash = YAML::load_file(path)
123
124
  @metadata = OpenStruct.new(hash)
125
+ @metadata.repository ||= @metadata.repozitory # temporary hack for old style metadata.yml
124
126
  rescue Errno::ENOENT # we might remove pupu directory, so metadata are missing, but we can get them from cache
125
127
  @metadata
126
128
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Pupu
4
- VERSION = "0.1"
4
+ VERSION = "0.2"
5
5
  end
metadata CHANGED
@@ -1,18 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pupu
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- version: "0.1"
4
+ prerelease:
5
+ version: "0.2"
9
6
  platform: ruby
10
7
  authors:
11
8
  - "Jakub \xC5\xA0\xC5\xA5astn\xC3\xBD aka Botanicus"
12
9
  autorequire:
13
10
  bindir: bin
14
11
  cert_chain:
15
- date: 2011-02-18 00:00:00 +00:00
12
+ date: 2011-05-25 00:00:00 +02:00
16
13
  default_executable: pupu
17
14
  dependencies:
18
15
  - !ruby/object:Gem::Dependency
@@ -23,8 +20,6 @@ dependencies:
23
20
  requirements:
24
21
  - - ">="
25
22
  - !ruby/object:Gem::Version
26
- segments:
27
- - 0
28
23
  version: "0"
29
24
  type: :runtime
30
25
  version_requirements: *id001
@@ -36,8 +31,6 @@ dependencies:
36
31
  requirements:
37
32
  - - ">="
38
33
  - !ruby/object:Gem::Version
39
- segments:
40
- - 0
41
34
  version: "0"
42
35
  type: :development
43
36
  version_requirements: *id002
@@ -333,7 +326,9 @@ files:
333
326
  - gems/cache/rspec-1.3.0.gem
334
327
  - gems/cache/term-ansicolor-1.0.4.gem
335
328
  - lib/pupu.rb
329
+ - lib/pupu/adapters/ace.rb
336
330
  - lib/pupu/adapters/merb.rb
331
+ - lib/pupu/adapters/padrino.rb
337
332
  - lib/pupu/adapters/rails.rb
338
333
  - lib/pupu/adapters/rango.rb
339
334
  - lib/pupu/cli.rb
@@ -415,23 +410,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
415
410
  requirements:
416
411
  - - ~>
417
412
  - !ruby/object:Gem::Version
418
- segments:
419
- - 1
420
- - 9
421
- - 1
422
413
  version: 1.9.1
423
414
  required_rubygems_version: !ruby/object:Gem::Requirement
424
415
  none: false
425
416
  requirements:
426
417
  - - ">="
427
418
  - !ruby/object:Gem::Version
428
- segments:
429
- - 0
430
419
  version: "0"
431
420
  requirements: []
432
421
 
433
422
  rubyforge_project: pupu
434
- rubygems_version: 1.3.7
423
+ rubygems_version: 1.5.3
435
424
  signing_key:
436
425
  specification_version: 3
437
426
  summary: Framework-agnostic package system for media files