gollum_rails 1.4.0.rc2 → 1.4.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -6
  3. data/Gemfile.lock +7 -10
  4. data/HISTORY.md +91 -91
  5. data/LICENSE +661 -661
  6. data/README.md +74 -74
  7. data/Rakefile +170 -170
  8. data/gollum_rails.gemspec +6 -4
  9. data/lib/core_ext/string.rb +3 -7
  10. data/lib/generators/gollum_rails/install/install_generator.rb +27 -27
  11. data/lib/generators/gollum_rails/install/templates/gollum_initializer.rb +22 -22
  12. data/lib/generators/gollum_rails/language/language_generator.rb +81 -81
  13. data/lib/generators/gollum_rails/model/model_generator.rb +51 -51
  14. data/lib/generators/gollum_rails/model/templates/model_template.erb +13 -13
  15. data/lib/gollum_rails.rb +26 -6
  16. data/lib/gollum_rails/adapters/activemodel.rb +36 -36
  17. data/lib/gollum_rails/adapters/activemodel/boolean.rb +15 -15
  18. data/lib/gollum_rails/adapters/activemodel/error.rb +27 -27
  19. data/lib/gollum_rails/adapters/activemodel/naming.rb +42 -42
  20. data/lib/gollum_rails/adapters/gollum.rb +54 -54
  21. data/lib/gollum_rails/adapters/gollum/.gitkeep +0 -0
  22. data/lib/gollum_rails/adapters/gollum/error.rb +19 -19
  23. data/lib/gollum_rails/adapters/gollum/page.rb +177 -177
  24. data/lib/gollum_rails/adapters/gollum/wiki.rb +42 -42
  25. data/lib/gollum_rails/page.rb +266 -266
  26. data/lib/gollum_rails/setup.rb +81 -81
  27. data/lib/grit/git-ruby/internal/pack.rb +397 -397
  28. data/spec/gollum_rails/adapters/activemodel/error_spec.rb +11 -11
  29. data/spec/gollum_rails/adapters/activemodel/naming_spec.rb +27 -27
  30. data/spec/gollum_rails/adapters/activemodel/validation_unused.rb +102 -102
  31. data/spec/gollum_rails/adapters/gollum/committer_spec.rb +0 -0
  32. data/spec/gollum_rails/adapters/gollum/connector_spec.rb +15 -15
  33. data/spec/gollum_rails/adapters/gollum/error_spec.rb +7 -7
  34. data/spec/gollum_rails/adapters/gollum/page_spec.rb +89 -89
  35. data/spec/gollum_rails/adapters/gollum/wiki_spec.rb +27 -27
  36. data/spec/gollum_rails/error_spec.rb +10 -0
  37. data/spec/gollum_rails/page_spec.rb +207 -207
  38. data/spec/gollum_rails/respository_spec.rb +0 -0
  39. data/spec/gollum_rails/setup_spec.rb +44 -44
  40. data/spec/gollum_rails/wiki_spec.rb +0 -0
  41. data/spec/gollum_rails_spec.rb +9 -0
  42. data/spec/spec.opts +3 -3
  43. data/spec/spec_helper.rb +43 -43
  44. metadata +4 -5
  45. data/lib/gollum_rails/modules/hash.rb +0 -33
  46. data/lib/gollum_rails/modules/loader.rb +0 -5
  47. data/spec/gollum_rails/modules/hash_spec.rb +0 -31
data/gollum_rails.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.name = 'gollum_rails'
5
5
  s.rubyforge_project = s.name
6
6
 
7
- s.version = '1.4.0.rc2'
7
+ s.version = '1.4.0.rc3'
8
8
 
9
9
  s.summary = 'Combines Gollum and Rails'
10
10
  s.description= 'include Gollum into Rails with ease'
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.platform = Gem::Platform::RUBY
24
24
  s.required_ruby_version = '>=1.9.3'
25
25
 
26
+
26
27
  # = MANIFEST =
27
28
  s.files = %w[
28
29
  Gemfile
@@ -48,8 +49,6 @@ Gem::Specification.new do |s|
48
49
  lib/gollum_rails/adapters/gollum/error.rb
49
50
  lib/gollum_rails/adapters/gollum/page.rb
50
51
  lib/gollum_rails/adapters/gollum/wiki.rb
51
- lib/gollum_rails/modules/hash.rb
52
- lib/gollum_rails/modules/loader.rb
53
52
  lib/gollum_rails/page.rb
54
53
  lib/gollum_rails/setup.rb
55
54
  lib/grit/git-ruby/internal/pack.rb
@@ -61,11 +60,12 @@ Gem::Specification.new do |s|
61
60
  spec/gollum_rails/adapters/gollum/error_spec.rb
62
61
  spec/gollum_rails/adapters/gollum/page_spec.rb
63
62
  spec/gollum_rails/adapters/gollum/wiki_spec.rb
64
- spec/gollum_rails/modules/hash_spec.rb
63
+ spec/gollum_rails/error_spec.rb
65
64
  spec/gollum_rails/page_spec.rb
66
65
  spec/gollum_rails/respository_spec.rb
67
66
  spec/gollum_rails/setup_spec.rb
68
67
  spec/gollum_rails/wiki_spec.rb
68
+ spec/gollum_rails_spec.rb
69
69
  spec/spec.opts
70
70
  spec/spec_helper.rb
71
71
  ]
@@ -83,3 +83,5 @@ Gem::Specification.new do |s|
83
83
  \trails g gollum_rails:language LANGUAGE
84
84
  END
85
85
  end
86
+
87
+
@@ -1,7 +1,3 @@
1
- class String
2
- if ((defined? RUBY_VERSION) && (['1.9', '2.0', '2.1'].include? RUBY_VERSION[0..2]))
3
- def getord(offset); self[offset].ord; end
4
- else
5
- alias :getord :[]
6
- end
7
- end
1
+ class String
2
+ def getord(offset); self[offset].ord; end
3
+ end
@@ -1,27 +1,27 @@
1
- require 'rails/generators'
2
-
3
- module GollumRails
4
-
5
- # Generators for GollumRails
6
- module Generators
7
-
8
- # Installation generator
9
- class InstallGenerator < ::Rails::Generators::Base
10
- source_root File.expand_path("../templates", __FILE__)
11
- desc "This generator will install gollum_rails"
12
-
13
- # Installs the necessary files
14
- def install_application
15
- if File.exist? 'config/initializers/gollum.rb'
16
- puts <<-EOM
17
- Warning! 'config/initializers/gollum.rb' exists
18
- It should be removed, as it may contain data of a previous installation
19
- EOM
20
- else
21
- copy_file "gollum_initializer.rb", "config/initializers/gollum.rb"
22
- end
23
- end
24
- end
25
- end
26
- end
27
-
1
+ require 'rails/generators'
2
+
3
+ module GollumRails
4
+
5
+ # Generators for GollumRails
6
+ module Generators
7
+
8
+ # Installation generator
9
+ class InstallGenerator < ::Rails::Generators::Base
10
+ source_root File.expand_path("../templates", __FILE__)
11
+ desc "This generator will install gollum_rails"
12
+
13
+ # Installs the necessary files
14
+ def install_application
15
+ if File.exist? 'config/initializers/gollum.rb'
16
+ puts <<-EOM
17
+ Warning! 'config/initializers/gollum.rb' exists
18
+ It should be removed, as it may contain data of a previous installation
19
+ EOM
20
+ else
21
+ copy_file "gollum_initializer.rb", "config/initializers/gollum.rb"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+
@@ -1,22 +1,22 @@
1
- # Initializer for the GollumRails gem.
2
- GollumRails::Setup.build do |config|
3
-
4
- # Set the path to the GIT-Repository.
5
- #
6
- # Possible values are:
7
- #
8
- # => an absolute path: '/home/railsapp/db/wiki.git'
9
- # => a relative path: Path.join(RAILS_ROOT, 'db', 'wiki.git')
10
- # => a symbol (only application) it uses the currently active rails environment configuration for the path
11
- #
12
- config.repository = :application
13
-
14
- # Tells GollumRails to startup.
15
- #
16
- # By default this value is disabled, because no path is set
17
- #
18
- # Possible values are:
19
- #
20
- # true or false
21
- config.startup = false
22
- end
1
+ # Initializer for the GollumRails gem.
2
+ GollumRails::Setup.build do |config|
3
+
4
+ # Set the path to the GIT-Repository.
5
+ #
6
+ # Possible values are:
7
+ #
8
+ # => an absolute path: '/home/railsapp/db/wiki.git'
9
+ # => a relative path: Path.join(RAILS_ROOT, 'db', 'wiki.git')
10
+ # => a symbol (only application) it uses the currently active rails environment configuration for the path
11
+ #
12
+ config.repository = :application
13
+
14
+ # Tells GollumRails to startup.
15
+ #
16
+ # By default this value is disabled, because no path is set
17
+ #
18
+ # Possible values are:
19
+ #
20
+ # true or false
21
+ config.startup = false
22
+ end
@@ -1,81 +1,81 @@
1
- require 'rails/generators'
2
-
3
- module GollumRails
4
-
5
- # Generators for GollumRails
6
- module Generators
7
-
8
- # Generates additional language files
9
- class LanguageGenerator < ::Rails::Generators::Base
10
- desc "This generator will install gollum_rails"
11
-
12
- argument :language, :type => :string
13
-
14
- # installs languages
15
- def install_languages
16
- case language
17
- when "ascii"
18
- puts <<-EOT
19
- \n Installation instructures for ASCIIDoc:\n
20
- \n\n Ubuntu/Debian Linux:
21
- \n (sudo) apt-get install asciidoc
22
- \n\n Mac with homebrew:
23
- \n brew install asciidoc
24
- \n
25
- EOT
26
- when "markdown"
27
- run "gem install redcarped"
28
- puts <<-EOT
29
- \n Parser for type "markdown" was installed
30
- \n
31
- EOT
32
- when "better-markdown"
33
- run "gem install github-markdown"
34
- puts <<-EOT
35
- \n Parser for type "github-markdown" was installed
36
- \n
37
- EOT
38
- when "textile"
39
- run "gem install RedCloth"
40
- puts <<-EOT
41
- \n Parser for type "textile" was installed
42
- \n
43
- EOT
44
- when "wiki"
45
- run "gem install wikicloth"
46
- puts <<-EOT
47
- \n Parser for type "wiki" was installed
48
- \n
49
- EOT
50
- when "org"
51
- run "gem install org-ruby"
52
- puts <<-EOT
53
- \n Parser for type "org-ruby" was installed
54
- \n
55
- EOT
56
- when "creole"
57
- run "gem install creole"
58
- puts <<-EOT
59
- \n Parser for type "creole" was installed
60
- \n
61
- EOT
62
- when "pod"
63
- puts <<-EOT
64
- \nPOT must be installed through CPAN (perl)
65
- \nSee http://search.cpan.org/dist/perl/pod/perlpod.pod for further information
66
- \n
67
- EOT
68
- when "rst"
69
- puts <<-EOT
70
- \nInstall through 'easy_install'
71
- \nSee http://docutils.sourceforge.net/rst.html for further information
72
- EOT
73
- else
74
- puts "UNKNOWN LANGUAGE"
75
- exit 1
76
- end
77
- end
78
- end
79
- end
80
- end
81
-
1
+ require 'rails/generators'
2
+
3
+ module GollumRails
4
+
5
+ # Generators for GollumRails
6
+ module Generators
7
+
8
+ # Generates additional language files
9
+ class LanguageGenerator < ::Rails::Generators::Base
10
+ desc "This generator will install gollum_rails"
11
+
12
+ argument :language, :type => :string
13
+
14
+ # installs languages
15
+ def install_languages
16
+ case language
17
+ when "ascii"
18
+ puts <<-EOT
19
+ \n Installation instructures for ASCIIDoc:\n
20
+ \n\n Ubuntu/Debian Linux:
21
+ \n (sudo) apt-get install asciidoc
22
+ \n\n Mac with homebrew:
23
+ \n brew install asciidoc
24
+ \n
25
+ EOT
26
+ when "markdown"
27
+ run "gem install redcarped"
28
+ puts <<-EOT
29
+ \n Parser for type "markdown" was installed
30
+ \n
31
+ EOT
32
+ when "better-markdown"
33
+ run "gem install github-markdown"
34
+ puts <<-EOT
35
+ \n Parser for type "github-markdown" was installed
36
+ \n
37
+ EOT
38
+ when "textile"
39
+ run "gem install RedCloth"
40
+ puts <<-EOT
41
+ \n Parser for type "textile" was installed
42
+ \n
43
+ EOT
44
+ when "wiki"
45
+ run "gem install wikicloth"
46
+ puts <<-EOT
47
+ \n Parser for type "wiki" was installed
48
+ \n
49
+ EOT
50
+ when "org"
51
+ run "gem install org-ruby"
52
+ puts <<-EOT
53
+ \n Parser for type "org-ruby" was installed
54
+ \n
55
+ EOT
56
+ when "creole"
57
+ run "gem install creole"
58
+ puts <<-EOT
59
+ \n Parser for type "creole" was installed
60
+ \n
61
+ EOT
62
+ when "pod"
63
+ puts <<-EOT
64
+ \nPOT must be installed through CPAN (perl)
65
+ \nSee http://search.cpan.org/dist/perl/pod/perlpod.pod for further information
66
+ \n
67
+ EOT
68
+ when "rst"
69
+ puts <<-EOT
70
+ \nInstall through 'easy_install'
71
+ \nSee http://docutils.sourceforge.net/rst.html for further information
72
+ EOT
73
+ else
74
+ puts "UNKNOWN LANGUAGE"
75
+ exit 1
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+
@@ -1,51 +1,51 @@
1
- require 'rails/generators'
2
-
3
- module GollumRails
4
-
5
- # Generators for GollumRails
6
- module Generators
7
-
8
- # Generates models
9
- class ModelGenerator < ::Rails::Generators::Base
10
- source_root File.expand_path("../templates", __FILE__)
11
- desc "This generator will create a model"
12
- argument :model_name, :type => :string
13
-
14
- # generates a model
15
- def create_model
16
- if ::File.exist? Rails.root.join("app", "models", "#{file_name}")
17
- raw = <<-EOM
18
- Warning: The file already exists
19
- EOM
20
- red raw
21
- else
22
- template "model_template.erb", "app/models/#{file_name}.rb"
23
- end
24
- end
25
-
26
- private
27
-
28
- # Gets the filename
29
- def file_name
30
- model_name.underscore
31
- end
32
-
33
- # Gets the classname
34
- def class_name
35
- model_name.camelize
36
- end
37
-
38
- # colorizes
39
- def colorize(text, color_code)
40
- "#{color_code}#{text}e[0m"
41
- end
42
-
43
- # colorizes red
44
- def red(text); colorize(text, "e[31m"); end
45
-
46
- # colorizes green
47
- def green(text); colorize(text, "e[32m"); end
48
- end
49
- end
50
- end
51
-
1
+ require 'rails/generators'
2
+
3
+ module GollumRails
4
+
5
+ # Generators for GollumRails
6
+ module Generators
7
+
8
+ # Generates models
9
+ class ModelGenerator < ::Rails::Generators::Base
10
+ source_root File.expand_path("../templates", __FILE__)
11
+ desc "This generator will create a model"
12
+ argument :model_name, :type => :string
13
+
14
+ # generates a model
15
+ def create_model
16
+ if ::File.exist? Rails.root.join("app", "models", "#{file_name}")
17
+ raw = <<-EOM
18
+ Warning: The file already exists
19
+ EOM
20
+ red raw
21
+ else
22
+ template "model_template.erb", "app/models/#{file_name}.rb"
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ # Gets the filename
29
+ def file_name
30
+ model_name.underscore
31
+ end
32
+
33
+ # Gets the classname
34
+ def class_name
35
+ model_name.camelize
36
+ end
37
+
38
+ # colorizes
39
+ def colorize(text, color_code)
40
+ "#{color_code}#{text}e[0m"
41
+ end
42
+
43
+ # colorizes red
44
+ def red(text); colorize(text, "e[31m"); end
45
+
46
+ # colorizes green
47
+ def green(text); colorize(text, "e[32m"); end
48
+ end
49
+ end
50
+ end
51
+
@@ -1,13 +1,13 @@
1
- # Gollum file
2
- class <%= class_name %> < GollumRails::Page
3
-
4
- # callbacks:
5
- #
6
- # after_save :after_save
7
- #
8
- # def after_save
9
- #
10
- # end
11
-
12
-
13
- end
1
+ # Gollum file
2
+ class <%= class_name %> < GollumRails::Page
3
+
4
+ # callbacks:
5
+ #
6
+ # after_save :after_save
7
+ #
8
+ # def after_save
9
+ #
10
+ # end
11
+
12
+
13
+ end