gollum_rails 1.4.0.rc1 → 1.4.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -6
  3. data/Gemfile.lock +2 -1
  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 +1 -1
  9. data/lib/core_ext/string.rb +7 -10
  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 +1 -1
  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/modules/hash.rb +33 -33
  26. data/lib/gollum_rails/modules/loader.rb +5 -5
  27. data/lib/gollum_rails/page.rb +266 -266
  28. data/lib/gollum_rails/setup.rb +81 -81
  29. data/lib/grit/git-ruby/internal/pack.rb +397 -397
  30. data/spec/gollum_rails/adapters/activemodel/error_spec.rb +11 -11
  31. data/spec/gollum_rails/adapters/activemodel/naming_spec.rb +27 -27
  32. data/spec/gollum_rails/adapters/activemodel/validation_unused.rb +102 -102
  33. data/spec/gollum_rails/adapters/gollum/committer_spec.rb +0 -0
  34. data/spec/gollum_rails/adapters/gollum/connector_spec.rb +15 -15
  35. data/spec/gollum_rails/adapters/gollum/error_spec.rb +7 -7
  36. data/spec/gollum_rails/adapters/gollum/page_spec.rb +89 -89
  37. data/spec/gollum_rails/adapters/gollum/wiki_spec.rb +27 -27
  38. data/spec/gollum_rails/modules/hash_spec.rb +31 -31
  39. data/spec/gollum_rails/page_spec.rb +207 -207
  40. data/spec/gollum_rails/respository_spec.rb +0 -0
  41. data/spec/gollum_rails/setup_spec.rb +44 -44
  42. data/spec/gollum_rails/wiki_spec.rb +0 -0
  43. data/spec/spec.opts +3 -3
  44. data/spec/spec_helper.rb +43 -43
  45. metadata +2 -2
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.rc1'
7
+ s.version = '1.4.0.rc2'
8
8
 
9
9
  s.summary = 'Combines Gollum and Rails'
10
10
  s.description= 'include Gollum into Rails with ease'
@@ -1,10 +1,7 @@
1
- class String
2
- if ((defined? RUBY_VERSION) && (['1.9', '2.0'].include? RUBY_VERSION[0..2]))
3
- def getord(offset); self[offset].ord; end
4
- else
5
- alias :getord :[]
6
- end
7
-
8
-
9
-
10
- end
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,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
data/lib/gollum_rails.rb CHANGED
@@ -16,7 +16,7 @@ module GollumRails
16
16
  autoload :Setup, 'gollum_rails/setup'
17
17
 
18
18
  # GollumRails version string
19
- VERSION = '1.4.0.rc1'
19
+ VERSION = '1.4.0.rc2'
20
20
 
21
21
  # Simplified error
22
22
  class Error < StandardError; end
@@ -1,36 +1,36 @@
1
- require 'active_model'
2
- module GollumRails
3
-
4
- # Adapter class. To be documented
5
- module Adapters
6
- # ActiveModel improvements and own connectors
7
- #
8
- # including:
9
- # * validation
10
- # * callbacks
11
- # * naming
12
- # * error handling
13
- #
14
- # The following files are involved:
15
- # * boolean.rb -> Boolean features for validation
16
- # * naming.rb -> Conversion and Naming
17
- # * error.rb -> Active Model error handling
18
- #
19
- # Released under the AGPL License. For further information see the LICENSE file distributed
20
- # with this package.
21
- #
22
- # TODO:
23
- # * a lot of testing
24
- #
25
- #
26
- module ActiveModel
27
-
28
- # connector version
29
- VERSION="1.21.0"
30
- end
31
- end
32
- end
33
-
34
- require File.expand_path '../activemodel/boolean', __FILE__
35
- require File.expand_path '../activemodel/naming', __FILE__
36
- require File.expand_path '../activemodel/error', __FILE__
1
+ require 'active_model'
2
+ module GollumRails
3
+
4
+ # Adapter class. To be documented
5
+ module Adapters
6
+ # ActiveModel improvements and own connectors
7
+ #
8
+ # including:
9
+ # * validation
10
+ # * callbacks
11
+ # * naming
12
+ # * error handling
13
+ #
14
+ # The following files are involved:
15
+ # * boolean.rb -> Boolean features for validation
16
+ # * naming.rb -> Conversion and Naming
17
+ # * error.rb -> Active Model error handling
18
+ #
19
+ # Released under the AGPL License. For further information see the LICENSE file distributed
20
+ # with this package.
21
+ #
22
+ # TODO:
23
+ # * a lot of testing
24
+ #
25
+ #
26
+ module ActiveModel
27
+
28
+ # connector version
29
+ VERSION="1.21.0"
30
+ end
31
+ end
32
+ end
33
+
34
+ require File.expand_path '../activemodel/boolean', __FILE__
35
+ require File.expand_path '../activemodel/naming', __FILE__
36
+ require File.expand_path '../activemodel/error', __FILE__