refinerycms-theming 0.9.9 → 0.9.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/app/models/theme.rb CHANGED
@@ -4,15 +4,15 @@ class Theme
4
4
  ::RefinerySetting[:theme]
5
5
  end
6
6
 
7
- def self.root
8
- Pathname.new( File.expand_path('../../../', __FILE__) )
9
- end
7
+ def self.root
8
+ Pathname.new( File.expand_path('../../../', __FILE__) )
9
+ end
10
10
 
11
- def self.current_theme_dir
12
- theme = self.current_theme
13
- theme_dir = Rails.root.join("themes",theme)
14
- theme_dir = self.root.join('themes', theme) unless theme_dir.directory?
15
- theme_dir
16
- end
11
+ def self.current_theme_dir
12
+ theme = self.current_theme
13
+ theme_dir = Rails.root.join("themes",theme)
14
+ theme_dir = self.root.join('themes', theme) unless theme_dir.directory?
15
+ theme_dir
16
+ end
17
17
 
18
18
  end
@@ -1,15 +1,20 @@
1
+ require File.expand_path('../../../lib/generators/refinery_theme/refinery_theme_generator', __FILE__)
2
+
1
3
  Before do
2
4
  @theme_generator_root = File.join(File.dirname(__FILE__), "/../../")
3
5
  @tmp_refinery_app_name = "tmp_refinery_app"
4
- @tmp_refinery_app_root = File.join(@theme_generator_root, @tmp_refinery_app_name)
6
+ require 'tmpdir'
7
+ @tmp_refinery_app_root = File.join(Dir.tmpdir, @tmp_refinery_app_name)
5
8
  @app_root = @tmp_refinery_app_root
6
- Rails::Generator::Base.append_sources(Rails::Generator::PathSource.new(:theme, "#{@theme_generator_root}/generators/"))
7
9
  end
8
10
 
9
11
  After do
10
12
  FileUtils.rm_rf(@tmp_refinery_app_root)
11
13
  end
12
14
 
13
- When /^I generate a theme with the name of "([^"]*)"$/ do |name|
14
- Rails::Generator::Scripts::Generate.new.run(['refinery_theme', name], {:quiet => true, :destination => @app_root})
15
+ When /^I generate a theme with the name "([^\"]*)"$/ do |name|
16
+ generator = RefineryThemeGenerator.new([name])
17
+ generator.destination_root = @app_root
18
+ generator.options = {:quiet => true}
19
+ generator.generate
15
20
  end
@@ -1,11 +1,13 @@
1
+ @theming
1
2
  Feature: Theme generation
2
3
  In order to create my own theme
3
4
  As a refinery user
4
5
  I want to generate a basic theme directory structure
5
6
 
7
+ @theming-generate
6
8
  Scenario: Generating a theme with a name
7
9
  Given I have a refinery application
8
- When I generate a theme with the name of "modern"
10
+ When I generate a theme with the name "modern"
9
11
  Then I should have a directory "themes/modern"
10
12
  And I should have a file "themes/modern/stylesheets/application.css"
11
13
  And I should have a file "themes/modern/stylesheets/home.css"
data/lib/gemspec.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- version = '0.9.9'
2
+ version = '0.9.9.1'
3
3
  raise "Could not get version so gemspec can not be built" if version.nil?
4
4
  files = Dir[%q{**/*}].flatten.reject{|f| f =~ /\.gem$/}
5
5
 
@@ -1,8 +1,8 @@
1
1
  class RefineryThemeGenerator < Rails::Generators::Base
2
- source_root File.expand_path('../templates', __FILE__)
2
+ source_root File.expand_path('../templates', __FILE__)
3
3
  argument :theme_name, :type => :string
4
4
 
5
- def create_theme
5
+ def generate
6
6
  copy_file "stylesheets/application.css", "themes/#{theme_name}/stylesheets/application.css"
7
7
  copy_file "stylesheets/formatting.css", "themes/#{theme_name}/stylesheets/formatting.css"
8
8
  copy_file "stylesheets/home.css", "themes/#{theme_name}/stylesheets/home.css"
@@ -12,6 +12,8 @@ class RefineryThemeGenerator < Rails::Generators::Base
12
12
  copy_file "views/pages/show.html.erb", "themes/#{theme_name}/views/pages/show.html.erb"
13
13
  copy_file "views/pages/home.html.erb", "themes/#{theme_name}/views/pages/home.html.erb"
14
14
 
15
+ copy_file "javascripts/application.js", "themes/#{theme_name}/javascripts/application.js"
16
+
15
17
  if RefinerySetting.get(:theme).nil?
16
18
  RefinerySetting.set(:theme, theme_name)
17
19
  puts "NOTE: \"theme\" setting created and set to #{theme_name}"
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place application specific javascripts into this file.
3
+ Include this into your template using javascript_include_tag('application', :theme => true)
4
+ */
@@ -74,6 +74,13 @@ module Refinery
74
74
  end
75
75
  end
76
76
 
77
+ config.after_initialize do
78
+ ::Refinery::Plugin.register do |plugin|
79
+ plugin.name = "refinerycms_theming_plugin"
80
+ plugin.version = '0.9.9.1'
81
+ end
82
+ end
83
+
77
84
  initializer 'themes.middleware' do |app|
78
85
  app.config.middleware.insert_before ::ActionDispatch::Static, ::Refinery::ThemeServer
79
86
  end
data/lib/theme_server.rb CHANGED
@@ -1,6 +1,3 @@
1
- # Allow the metal piece to run in isolation
2
- require File.expand_path('../../../config/environment', __FILE__) unless defined?(Rails)
3
-
4
1
  # Serves theme files from the theme directory without touching Rails too much
5
2
  module Refinery
6
3
  class ThemeServer
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{refinerycms-theming}
3
- s.version = %q{0.9.9}
3
+ s.version = %q{0.9.9.1}
4
4
  s.description = %q{Theming functionality for the Refinery CMS project, extracted from Refinery CMS core.}
5
- s.date = %q{2010-12-15}
5
+ s.date = %q{2011-02-16}
6
6
  s.summary = %q{Theming functionality for the Refinery CMS project.}
7
7
  s.email = %q{info@refinerycms.com}
8
8
  s.homepage = %q{http://refinerycms.com}
@@ -26,6 +26,8 @@ Gem::Specification.new do |s|
26
26
  'lib/generators/refinery_theme/README',
27
27
  'lib/generators/refinery_theme/refinery_theme_generator.rb',
28
28
  'lib/generators/refinery_theme/templates',
29
+ 'lib/generators/refinery_theme/templates/javascripts',
30
+ 'lib/generators/refinery_theme/templates/javascripts/application.js',
29
31
  'lib/generators/refinery_theme/templates/stylesheets',
30
32
  'lib/generators/refinery_theme/templates/stylesheets/application.css',
31
33
  'lib/generators/refinery_theme/templates/stylesheets/formatting.css',
@@ -661,10 +661,10 @@ img.alignleft {
661
661
 
662
662
  /*
663
663
  Firefox Dotted Line Fix
664
- - http://sonspring.com/journal/removing-dotted-links
664
+ - http://sonspring.com/journal/removing-dotted-links
665
665
  */
666
666
  a:focus {
667
- outline: none;
667
+ outline: none;
668
668
  }
669
669
 
670
670
  /*
@@ -673,19 +673,19 @@ Clearfix docs
673
673
  - IE7 change: http://www.456bereastreet.com/archive/200603/new_clearing_method_needed_for_ie7/
674
674
  */
675
675
  .clearfix:after {
676
- content: ".";
677
- display: block;
678
- height: 0;
679
- clear: both;
680
- visibility: hidden;
676
+ content: ".";
677
+ display: block;
678
+ height: 0;
679
+ clear: both;
680
+ visibility: hidden;
681
681
  }
682
682
  .clearfix {
683
- display: inline-block;
683
+ display: inline-block;
684
684
  }
685
685
 
686
686
  /* Hide from IE Mac \*/
687
687
  .clearfix {
688
- display:block;
688
+ display:block;
689
689
  }
690
690
  /* End hide from IE Mac */
691
691
 
@@ -696,11 +696,11 @@ display: block;
696
696
  }
697
697
 
698
698
  .inquiries .field {
699
- margin: 12px 0px;
699
+ margin: 12px 0px;
700
700
  }
701
701
 
702
702
  .inquiries form {
703
- padding-top: 12px;
703
+ padding-top: 12px;
704
704
  }
705
705
 
706
706
  .page_not_live {
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-theming
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 9
8
- - 9
9
- version: 0.9.9
4
+ prerelease:
5
+ version: 0.9.9.1
10
6
  platform: ruby
11
7
  authors:
12
8
  - Resolve Digital
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-12-15 00:00:00 +13:00
13
+ date: 2011-02-16 00:00:00 +13:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,10 +21,6 @@ dependencies:
25
21
  requirements:
26
22
  - - ">="
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 9
31
- - 9
32
24
  version: 0.9.9
33
25
  type: :runtime
34
26
  version_requirements: *id001
@@ -48,6 +40,7 @@ files:
48
40
  - lib/generators/refinery_theme/Rakefile
49
41
  - lib/generators/refinery_theme/README
50
42
  - lib/generators/refinery_theme/refinery_theme_generator.rb
43
+ - lib/generators/refinery_theme/templates/javascripts/application.js
51
44
  - lib/generators/refinery_theme/templates/stylesheets/application.css
52
45
  - lib/generators/refinery_theme/templates/stylesheets/formatting.css
53
46
  - lib/generators/refinery_theme/templates/stylesheets/home.css
@@ -100,21 +93,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
93
  requirements:
101
94
  - - ">="
102
95
  - !ruby/object:Gem::Version
103
- segments:
104
- - 0
105
96
  version: "0"
106
97
  required_rubygems_version: !ruby/object:Gem::Requirement
107
98
  none: false
108
99
  requirements:
109
100
  - - ">="
110
101
  - !ruby/object:Gem::Version
111
- segments:
112
- - 0
113
102
  version: "0"
114
103
  requirements: []
115
104
 
116
105
  rubyforge_project:
117
- rubygems_version: 1.3.7
106
+ rubygems_version: 1.5.2
118
107
  signing_key:
119
108
  specification_version: 3
120
109
  summary: Theming functionality for the Refinery CMS project.