guides 0.6.8.1 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,4 +5,5 @@ gemspec
5
5
  group :development do
6
6
  gem "rspec", "~> 2.0"
7
7
  gem "faraday", "~> 0.5.0"
8
+ gem "packager"
8
9
  end
data/Rakefile CHANGED
@@ -1,127 +1,16 @@
1
- require "bundler/setup"
2
- require "guides/version"
3
- require "erb"
1
+ require File.expand_path('../lib/guides/version', __FILE__)
4
2
 
5
- file "Guides/local/guides/bundle" => "Gemfile" do
6
- require "rbconfig"
3
+ begin
4
+ require 'packager/rake_task'
7
5
 
8
- unless Config::CONFIG["target_cpu"] == "universal"
9
- puts "Please use a universal binary copy of ruby"
10
- exit 1
6
+ Packager::RakeTask.new(:pkg) do |t|
7
+ t.version = Guides::VERSION
8
+ t.domain = "strobecorp.com"
9
+ t.package_name = "Guides"
10
+ t.bin_files = ['guides']
11
11
  end
12
-
13
- unless RUBY_VERSION == "1.9.2"
14
- puts "Please use Ruby 1.9.2"
15
- exit 1
16
- end
17
-
18
- puts "Regenerating the bundle."
19
-
20
- sh "rm -rf bundle"
21
- Bundler.with_clean_env do
22
- sh "bundle --standalone --local --without development"
23
- end
24
- sh "mkdir -p Guides/local/guides"
25
- sh "cp -R bundle Guides/local/guides/"
26
-
27
- verbose(false) do
28
- Dir.chdir("Guides/local/guides/bundle/ruby/1.9.1") do
29
- Dir["{bin,cache,doc,specifications}"].each { |f| rm_rf f }
30
- Dir["**/{ext,docs,test,spec}"].each { |f| rm_rf(f) if File.directory?(f) && f !~ /maruku/i }
31
- Dir["**/erubis-*/doc-api"].each {|f| rm_rf(f) }
32
- end
12
+ rescue LoadError
13
+ if Rake.application.options.show_tasks
14
+ puts "`gem install packager` for packaging tasks"
33
15
  end
34
16
  end
35
-
36
- file "Guides/local/guides/lib"
37
-
38
- `git ls-files -- lib`.split("\n").each do |file|
39
- dest = "Guides/local/guides/#{file}"
40
- file dest => file do
41
- verbose(false) { mkdir_p File.dirname(dest) }
42
- cp_r file, dest
43
- end
44
- task "Guides/local/guides/lib" => dest
45
- end
46
-
47
- file "Guides/bin/guides" => "bin/guides" do
48
- guides = File.read("bin/guides").sub(/\A#.*/, "#!/usr/local/ruby1.9/bin/ruby -I /usr/local/guides/bundle -r bundler/setup")
49
-
50
- sh "mkdir -p Guides/bin"
51
- File.open("Guides/bin/guides", "w") { |file| file.puts guides }
52
- File.chmod 0755, "Guides/bin/guides"
53
- end
54
-
55
- desc "Prep the release for PackageMaker"
56
- task :make_pkg => ["Guides/local/guides/bundle", "Guides/local/guides/lib", "Guides/bin/guides"]
57
-
58
- task :rm do
59
- rm_rf "Guides"
60
- end
61
-
62
- directory "guides-pkg/Resources"
63
- directory "guides-pkg/guides.pkg"
64
-
65
- pkg_dependencies = [:make_pkg, "guides-pkg/Resources", "guides-pkg/guides.pkg",
66
- "guides-pkg/Distribution", "guides-pkg/guides.pkg/Bom",
67
- "guides-pkg/guides.pkg/PackageInfo", "guides-pkg/guides.pkg/Payload"]
68
-
69
- def details
70
- @details ||= begin
71
- total_size, files = 0, 0
72
-
73
- Dir["Guides/**/*"].each do |file|
74
- files += 1
75
-
76
- next if File.directory?(file)
77
-
78
- total_size += File.size(file)
79
- end
80
-
81
- [total_size, files]
82
- end
83
- end
84
-
85
- file "guides-pkg/Distribution" do
86
- src = File.read File.expand_path("../build/Distribution.erb", __FILE__)
87
- erb = ERB.new(src)
88
-
89
- total_size, files = details
90
-
91
- kbytes = total_size / 1024
92
- version = Guides::VERSION
93
-
94
- File.open("guides-pkg/Distribution", "w") do |file|
95
- file.puts erb.result(binding)
96
- end
97
- end
98
-
99
- file "guides-pkg/guides.pkg/PackageInfo" do
100
- src = File.read File.expand_path("../build/PackageInfo.erb", __FILE__)
101
- erb = ERB.new(src)
102
-
103
- total_size, num_files = details
104
-
105
- kbytes = total_size / 1024
106
- version = Guides::VERSION
107
-
108
- File.open("guides-pkg/guides.pkg/PackageInfo", "w") do |file|
109
- file.puts erb.result(binding)
110
- end
111
- end
112
-
113
- file "guides-pkg/guides.pkg/Bom" do
114
- sh "mkbom -s Guides guides-pkg/guides.pkg/Bom"
115
- end
116
-
117
- file "guides-pkg/guides.pkg/Payload" do
118
- sh "cd Guides && pax -wz -x cpio . > ../guides-pkg/guides.pkg/Payload"
119
- end
120
-
121
- file "Guides.pkg" => pkg_dependencies do
122
- sh "pkgutil --flatten guides-pkg Guides.pkg"
123
- end
124
-
125
- task :pkg => "Guides.pkg"
126
-
127
- task :clean => [:rm, :pkg]
@@ -195,11 +195,7 @@ module Guides
195
195
  end
196
196
 
197
197
  def set_index(body, view, processor)
198
- index = <<-INDEX
199
- <div id="subCol">
200
- <h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
201
- <ol class="chapters">
202
- INDEX
198
+ index = ""
203
199
 
204
200
  i = Indexer.new(body, warnings, @production)
205
201
  i.index
@@ -223,9 +219,6 @@ module Guides
223
219
  index << view.content_tag(:li, link.html_safe + children_ul.html_safe)
224
220
  end
225
221
 
226
- index << '</ol>'
227
- index << '</div>'
228
-
229
222
  view.content_for(:index_section) { index.html_safe }
230
223
 
231
224
  i.result
@@ -50,7 +50,7 @@ module Guides
50
50
  result = content_tag(:img, nil, :src => image, :class => 'left pic', :alt => name)
51
51
  result << content_tag(:h3, name)
52
52
  result << content_tag(:p, capture(&block))
53
- content_tag(:div, result, :class => 'clearfix', :id => nick)
53
+ content_tag(:div, result, :class => 'author clearfix', :id => nick)
54
54
  end
55
55
 
56
56
  def code(&block)
@@ -54,7 +54,10 @@
54
54
  <h2><%= Guides.meta["title"] %></h2>
55
55
  <p><%= Guides.meta["description"] %></p>
56
56
  <% end %>
57
- <%= yield(:index_section) %>
57
+ <div id="subCol">
58
+ <h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
59
+ <ol class="chapters"><%= yield(:index_section) %></ol>
60
+ </div>
58
61
  </div>
59
62
  </div>
60
63
 
@@ -1,3 +1,3 @@
1
1
  module Guides
2
- VERSION = "0.6.8.1"
2
+ VERSION = "0.6.9"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: guides
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.8.1
5
+ version: 0.6.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Yehuda Katz
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-27 00:00:00 Z
13
+ date: 2011-05-11 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -103,8 +103,6 @@ files:
103
103
  - Gemfile
104
104
  - Rakefile
105
105
  - bin/guides
106
- - build/Distribution.erb
107
- - build/PackageInfo.erb
108
106
  - guides.gemspec
109
107
  - lib/guides.rb
110
108
  - lib/guides/cli.rb
@@ -256,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
254
  requirements: []
257
255
 
258
256
  rubyforge_project: guides
259
- rubygems_version: 1.7.1
257
+ rubygems_version: 1.7.2
260
258
  signing_key:
261
259
  specification_version: 3
262
260
  summary: Extracting the Rails Guides framework for the rest of us
@@ -1,23 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <installer-script minSpecVersion="1.000000" authoringTool="org.ruby-lang.rake" authoringToolVersion="0.8.7">
3
- <title>Guides</title>
4
- <options customize="never" allow-external-scripts="no"/>
5
- <domains enable_localSystem="true"/>
6
- <script>
7
- function ruby19p136_installed() {
8
- return !(system.files.fileExistsAtPath('/usr/local/ruby1.9') == true);
9
- }
10
- </script>
11
- <choices-outline>
12
- <line choice="ruby19p136"/>
13
- <line choice="guides"/>
14
- </choices-outline>
15
- <choice id="ruby19p136" title="ruby" start_selected="false" start_enabled="false" selected="ruby19p136_installed()" enabled="ruby19p136_installed()">
16
- <pkg-ref id="com.strobecorp.ruby19"/>
17
- </choice>
18
- <choice id="guides" title="Guides">
19
- <pkg-ref id="com.strobecorp.guides"/>
20
- </choice>
21
- <pkg-ref id="com.strobecorp.ruby19" installKBytes="26156" archiveKBytes="7353" hash-sha256="7b9507f7a9178c0eaafd3ffcfd2e246400e82899e6f29df2f7c4fcec6ec04ac5" version="1.9.2p136" auth="Root">http://ruby-pkg.strobeapp.com/Ruby-1.9.2p136.pkg</pkg-ref>
22
- <pkg-ref id="com.strobecorp.guides" installKBytes="<%= kbytes %>" version="<%= version %>" auth="Root">#guides.pkg</pkg-ref>
23
- </installer-script>
@@ -1,4 +0,0 @@
1
- <pkg-info format-version="2" identifier="com.strobecorp.guides" version="<%= version %>" install-location="/usr" auth="root">
2
- <payload installKBytes="<%= kbytes %>" numberOfFiles="<%= num_files %>"/>
3
- </pkg-info>
4
-