refinerycms-core 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/gemspec.rb CHANGED
@@ -1,8 +1,10 @@
1
+ # Encoding: UTF-8
1
2
  require 'pathname'
2
3
  gempath = Pathname.new(File.expand_path('../../', __FILE__))
3
4
  require gempath.join('..', 'base', 'lib', 'base', 'refinery')
4
5
 
5
6
  gemspec = <<EOF
7
+ # Encoding: UTF-8
6
8
  # DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
7
9
 
8
10
  Gem::Specification.new do |s|
@@ -14,7 +16,7 @@ Gem::Specification.new do |s|
14
16
  s.email = %q{info@refinerycms.com}
15
17
  s.homepage = %q{http://refinerycms.com}
16
18
  s.rubyforge_project = %q{refinerycms}
17
- s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel']
19
+ s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel', 'Uģis Ozols']
18
20
  s.license = %q{MIT}
19
21
  s.require_paths = %w(lib)
20
22
  s.executables = %w(#{Pathname.glob(gempath.join('bin/*')).map{|d| d.relative_path_from(gempath)}.sort.join(" ")})
@@ -26,7 +28,7 @@ Gem::Specification.new do |s|
26
28
  s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
27
29
  s.add_dependency 'globalize3', '~> 0.1'
28
30
  s.add_dependency 'awesome_nested_set', '~> 2.0'
29
- s.add_dependency 'rails', '~> 3.0.7'
31
+ s.add_dependency 'rails', '~> 3.0.9'
30
32
  s.add_dependency 'truncate_html', '~> 0.5'
31
33
  s.add_dependency 'will_paginate', '~> 3.0.pre'
32
34
 
@@ -50,8 +50,15 @@ class RefinerycmsGenerator < ::Refinery::Generators::EngineInstaller
50
50
 
51
51
  gsub_file env, "serve_static_assets = false", "serve_static_assets = true # Refinery CMS requires this to be true", :verbose => false
52
52
 
53
- unless Rails.root.join(env).read =~ %r{Refinery.rescue_not_found}
54
- append_file env, "Refinery.rescue_not_found = #{env.split('/').last.split('.rb').first == 'production'}"
53
+ unless (env_file_contents = Rails.root.join(env).read) =~ %r{Refinery.rescue_not_found}
54
+ append_file env, "Refinery.rescue_not_found = #{env.split('/').last.split('.rb').first == 'production'}\n"
55
+ end
56
+
57
+ unless env_file_contents =~ %r{Refinery.s3_backend}
58
+ s3_backend_string = ["# When true will use Amazon's Simple Storage Service on your production machine"]
59
+ s3_backend_string << "# instead of the default file system for resources and images"
60
+ s3_backend_string << "Refinery.s3_backend = !(ENV['S3_KEY'].nil? || ENV['S3_SECRET'].nil?)\n"
61
+ append_file env, s3_backend_string.join("\n")
55
62
  end
56
63
  end
57
64
 
@@ -3,10 +3,14 @@ module Refinery
3
3
 
4
4
  class Plugin
5
5
 
6
- def self.register(&block)
7
- plugin = self.new
6
+ attr_accessor :name, :class_name, :controller, :directory, :url,
7
+ :version, :dashboard, :always_allow_access,
8
+ :menu_match, :hide_from_menu,
9
+ :pathname, :plugin_activity
10
+ attr_reader :description
8
11
 
9
- yield plugin
12
+ def self.register(&block)
13
+ yield(plugin = self.new)
10
14
 
11
15
  raise "A plugin MUST have a name!: #{plugin.inspect}" if plugin.name.blank?
12
16
 
@@ -23,13 +27,12 @@ module Refinery
23
27
  def self.called_from; "#{new_called_from}"; end
24
28
  RUBY
25
29
  Object.const_set(plugin.class_name.to_sym, klass)
26
- end
27
30
 
28
- attr_accessor :name, :class_name, :controller, :directory, :url,
29
- :version, :dashboard, :always_allow_access,
30
- :menu_match, :hide_from_menu,
31
- :pathname, :plugin_activity
32
- attr_reader :description
31
+ # provide a default pathname to where this plugin is using its lib directory.
32
+ depth = RUBY_VERSION >= "1.9.2" ? 4 : 3
33
+ plugin.pathname ||= Pathname.new(caller(depth).first.match("(.*)#{File::SEPARATOR}lib")[1])
34
+ Refinery::Plugins.registered << plugin # add me to the collection of registered plugins
35
+ end
33
36
 
34
37
  # Returns the class name of the plugin
35
38
  def class_name
@@ -76,6 +79,11 @@ module Refinery
76
79
  @menu_match ||= /(admin|refinery)\/#{self.name}$/
77
80
  end
78
81
 
82
+ def pathname=(value)
83
+ value = Pathname.new(value) if value.is_a? String
84
+ @pathname = value
85
+ end
86
+
79
87
  # Returns a hash that can be used to create a url that points to the administration part of the plugin.
80
88
  def url
81
89
  @url ||= if self.controller.present?
@@ -93,12 +101,5 @@ module Refinery
93
101
  def add_activity(options)
94
102
  (self.plugin_activity ||= []) << Activity::new(options)
95
103
  end
96
-
97
- def initialize
98
- # save the pathname to where this plugin is using its lib directory which is standard now.
99
- depth = RUBY_VERSION >= "1.9.2" ? 4 : 3
100
- self.pathname = Pathname.new(caller(depth).first.match("(.*)#{File::SEPARATOR}lib")[1])
101
- Refinery::Plugins.registered << self # add me to the collection of registered plugins
102
- end
103
104
  end
104
105
  end
@@ -100,6 +100,7 @@ module Refinery
100
100
  # Register the plugin
101
101
  config.after_initialize do
102
102
  ::Refinery::Plugin.register do |plugin|
103
+ plugin.pathname = root
103
104
  plugin.name = 'refinery_core'
104
105
  plugin.class_name = 'RefineryEngine'
105
106
  plugin.version = ::Refinery.version
@@ -110,6 +111,7 @@ module Refinery
110
111
 
111
112
  # Register the dialogs plugin
112
113
  ::Refinery::Plugin.register do |plugin|
114
+ plugin.pathname = root
113
115
  plugin.name = 'refinery_dialogs'
114
116
  plugin.version = ::Refinery.version
115
117
  plugin.hide_from_menu = true
@@ -1,27 +1,28 @@
1
+ # Encoding: UTF-8
1
2
  # DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
2
3
 
3
4
  Gem::Specification.new do |s|
4
5
  s.name = %q{refinerycms-core}
5
- s.version = %q{1.0.0}
6
+ s.version = %q{1.0.1}
6
7
  s.summary = %q{Core engine for Refinery CMS}
7
8
  s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
8
- s.date = %q{2011-05-28}
9
+ s.date = %q{2011-06-21}
9
10
  s.email = %q{info@refinerycms.com}
10
11
  s.homepage = %q{http://refinerycms.com}
11
12
  s.rubyforge_project = %q{refinerycms}
12
- s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel']
13
+ s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel', 'Uģis Ozols']
13
14
  s.license = %q{MIT}
14
15
  s.require_paths = %w(lib)
15
16
  s.executables = %w()
16
17
 
17
- s.add_dependency 'refinerycms-base', '= 1.0.0'
18
- s.add_dependency 'refinerycms-settings', '= 1.0.0'
18
+ s.add_dependency 'refinerycms-base', '= 1.0.1'
19
+ s.add_dependency 'refinerycms-settings', '= 1.0.1'
19
20
  s.add_dependency 'refinerycms-generators', '~> 1.0'
20
21
  s.add_dependency 'acts_as_indexed', '~> 0.7'
21
22
  s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
22
23
  s.add_dependency 'globalize3', '~> 0.1'
23
24
  s.add_dependency 'awesome_nested_set', '~> 2.0'
24
- s.add_dependency 'rails', '~> 3.0.7'
25
+ s.add_dependency 'rails', '~> 3.0.9'
25
26
  s.add_dependency 'truncate_html', '~> 0.5'
26
27
  s.add_dependency 'will_paginate', '~> 3.0.pre'
27
28
 
@@ -61,6 +61,29 @@ module Refinery
61
61
 
62
62
  end
63
63
 
64
+ describe '#pathname' do
65
+ it 'should be set by default' do
66
+ plugin.pathname.should_not == nil
67
+ end
68
+ end
69
+
70
+ describe '#pathname=' do
71
+ it 'converts string input to pathname' do
72
+ plugin.pathname = Rails.root.to_s
73
+ plugin.pathname.should == Rails.root
74
+ end
75
+
76
+ it 'overrides the default pathname' do
77
+ current_pathname = plugin.pathname
78
+ new_pathname = current_pathname.join('tmp', 'path')
79
+
80
+ current_pathname.should_not == new_pathname
81
+
82
+ plugin.pathname = new_pathname
83
+ plugin.pathname.should == new_pathname
84
+ end
85
+ end
86
+
64
87
  describe '#always_allow_access?' do
65
88
  it 'returns false if @always_allow_access is not set or its set to false' do
66
89
  plugin.always_allow_access?.should be_false
metadata CHANGED
@@ -1,20 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-core
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 21
4
5
  prerelease:
5
- version: 1.0.0
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 1
10
+ version: 1.0.1
6
11
  platform: ruby
7
12
  authors:
8
13
  - Resolve Digital
9
14
  - Philip Arndt
10
15
  - David Jones
11
16
  - Steven Heidel
17
+ - "U\xC4\xA3is Ozols"
12
18
  autorequire:
13
19
  bindir: bin
14
20
  cert_chain: []
15
21
 
16
- date: 2011-05-28 00:00:00 +12:00
17
- default_executable:
22
+ date: 2011-06-21 00:00:00 Z
18
23
  dependencies:
19
24
  - !ruby/object:Gem::Dependency
20
25
  name: refinerycms-base
@@ -24,7 +29,12 @@ dependencies:
24
29
  requirements:
25
30
  - - "="
26
31
  - !ruby/object:Gem::Version
27
- version: 1.0.0
32
+ hash: 21
33
+ segments:
34
+ - 1
35
+ - 0
36
+ - 1
37
+ version: 1.0.1
28
38
  type: :runtime
29
39
  version_requirements: *id001
30
40
  - !ruby/object:Gem::Dependency
@@ -35,7 +45,12 @@ dependencies:
35
45
  requirements:
36
46
  - - "="
37
47
  - !ruby/object:Gem::Version
38
- version: 1.0.0
48
+ hash: 21
49
+ segments:
50
+ - 1
51
+ - 0
52
+ - 1
53
+ version: 1.0.1
39
54
  type: :runtime
40
55
  version_requirements: *id002
41
56
  - !ruby/object:Gem::Dependency
@@ -46,6 +61,10 @@ dependencies:
46
61
  requirements:
47
62
  - - ~>
48
63
  - !ruby/object:Gem::Version
64
+ hash: 15
65
+ segments:
66
+ - 1
67
+ - 0
49
68
  version: "1.0"
50
69
  type: :runtime
51
70
  version_requirements: *id003
@@ -57,6 +76,10 @@ dependencies:
57
76
  requirements:
58
77
  - - ~>
59
78
  - !ruby/object:Gem::Version
79
+ hash: 5
80
+ segments:
81
+ - 0
82
+ - 7
60
83
  version: "0.7"
61
84
  type: :runtime
62
85
  version_requirements: *id004
@@ -68,6 +91,11 @@ dependencies:
68
91
  requirements:
69
92
  - - ~>
70
93
  - !ruby/object:Gem::Version
94
+ hash: 13
95
+ segments:
96
+ - 3
97
+ - 2
98
+ - 1
71
99
  version: 3.2.1
72
100
  type: :runtime
73
101
  version_requirements: *id005
@@ -79,6 +107,10 @@ dependencies:
79
107
  requirements:
80
108
  - - ~>
81
109
  - !ruby/object:Gem::Version
110
+ hash: 9
111
+ segments:
112
+ - 0
113
+ - 1
82
114
  version: "0.1"
83
115
  type: :runtime
84
116
  version_requirements: *id006
@@ -90,6 +122,10 @@ dependencies:
90
122
  requirements:
91
123
  - - ~>
92
124
  - !ruby/object:Gem::Version
125
+ hash: 3
126
+ segments:
127
+ - 2
128
+ - 0
93
129
  version: "2.0"
94
130
  type: :runtime
95
131
  version_requirements: *id007
@@ -101,7 +137,12 @@ dependencies:
101
137
  requirements:
102
138
  - - ~>
103
139
  - !ruby/object:Gem::Version
104
- version: 3.0.7
140
+ hash: 21
141
+ segments:
142
+ - 3
143
+ - 0
144
+ - 9
145
+ version: 3.0.9
105
146
  type: :runtime
106
147
  version_requirements: *id008
107
148
  - !ruby/object:Gem::Dependency
@@ -112,6 +153,10 @@ dependencies:
112
153
  requirements:
113
154
  - - ~>
114
155
  - !ruby/object:Gem::Version
156
+ hash: 1
157
+ segments:
158
+ - 0
159
+ - 5
115
160
  version: "0.5"
116
161
  type: :runtime
117
162
  version_requirements: *id009
@@ -123,6 +168,11 @@ dependencies:
123
168
  requirements:
124
169
  - - ~>
125
170
  - !ruby/object:Gem::Version
171
+ hash: 961915916
172
+ segments:
173
+ - 3
174
+ - 0
175
+ - pre
126
176
  version: 3.0.pre
127
177
  type: :runtime
128
178
  version_requirements: *id010
@@ -479,7 +529,6 @@ files:
479
529
  - spec/controllers/sitemap_controller_spec.rb
480
530
  - spec/lib/refinery/plugin_spec.rb
481
531
  - spec/lib/refinery/plugins_spec.rb
482
- has_rdoc: true
483
532
  homepage: http://refinerycms.com
484
533
  licenses:
485
534
  - MIT
@@ -493,17 +542,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
493
542
  requirements:
494
543
  - - ">="
495
544
  - !ruby/object:Gem::Version
545
+ hash: 3
546
+ segments:
547
+ - 0
496
548
  version: "0"
497
549
  required_rubygems_version: !ruby/object:Gem::Requirement
498
550
  none: false
499
551
  requirements:
500
552
  - - ">="
501
553
  - !ruby/object:Gem::Version
554
+ hash: 3
555
+ segments:
556
+ - 0
502
557
  version: "0"
503
558
  requirements: []
504
559
 
505
560
  rubyforge_project: refinerycms
506
- rubygems_version: 1.6.2
561
+ rubygems_version: 1.8.5
507
562
  signing_key:
508
563
  specification_version: 3
509
564
  summary: Core engine for Refinery CMS