sections_rails 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,5 @@
1
1
  # Generates a new section.
2
2
  class SectionGenerator < Rails::Generators::Base
3
- include SectionsRails::Helpers
4
-
5
3
  argument :name, :type => :string
6
4
 
7
5
  def parse_arguments
@@ -1,3 +1,3 @@
1
1
  module SectionsRails
2
- VERSION = "0.6.8"
2
+ VERSION = "0.6.9"
3
3
  end
@@ -1,6 +1,5 @@
1
1
  module SectionsRails
2
2
  require 'action_view'
3
- require 'sections_rails/helpers'
4
3
  require "sections_rails/section"
5
4
  require "sections_rails/railtie" if defined?(Rails)
6
5
 
@@ -1,5 +1,4 @@
1
1
  namespace :sections do
2
- include SectionsRails::Helpers
3
2
 
4
3
  desc "Prepares the assets for precompilation in a setup with a single application.js file"
5
4
  task :prepare do
@@ -128,18 +127,6 @@ namespace :sections do
128
127
  []
129
128
  end
130
129
  end
131
-
132
- # Returns the path to the asset in the given section.
133
- def asset_path section_name, asset_extension = nil, asset_prefix = nil
134
- directory, filename = split_path section_name
135
- "app/sections/#{directory}#{filename}/#{asset_prefix}#{filename}#{asset_extension}"
136
- end
137
-
138
- # Returns the relative path to the asset for the asset pipeline.
139
- def require_path section_name
140
- directory, filename = split_path section_name
141
- "../../sections/#{directory}#{filename}/#{filename}"
142
- end
143
130
  end
144
131
 
145
132
  # Run the 'sections:prepare' rake task automatically before the 'assets:precompile' rake task
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sections_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70203401926000 !ruby/object:Gem::Requirement
16
+ requirement: &70290446057980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70203401926000
24
+ version_requirements: *70290446057980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70203401925460 !ruby/object:Gem::Requirement
27
+ requirement: &70290446056860 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70203401925460
35
+ version_requirements: *70290446056860
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &70203401924800 !ruby/object:Gem::Requirement
38
+ requirement: &70290446056160 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70203401924800
46
+ version_requirements: *70290446056160
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard-rspec
49
- requirement: &70203401924300 !ruby/object:Gem::Requirement
49
+ requirement: &70290446055200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70203401924300
57
+ version_requirements: *70290446055200
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rb-fsevent
60
- requirement: &70203401918100 !ruby/object:Gem::Requirement
60
+ requirement: &70290446054200 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70203401918100
68
+ version_requirements: *70290446054200
69
69
  description: Sections_rails adds infrastructure to the view layer of Ruby on Rails.
70
70
  It allows to define and use the HTML, CSS, and JavaScript code of dedicated sections
71
71
  of pages together in one place.
@@ -78,7 +78,6 @@ files:
78
78
  - lib/generators/section_generator.rb
79
79
  - lib/generators/sections_generator.rb
80
80
  - lib/sections_rails/config.rb
81
- - lib/sections_rails/helpers.rb
82
81
  - lib/sections_rails/railtie.rb
83
82
  - lib/sections_rails/section.rb
84
83
  - lib/sections_rails/version.rb
@@ -87,7 +86,6 @@ files:
87
86
  - MIT-LICENSE
88
87
  - Rakefile
89
88
  - README.md
90
- - spec/sections_rails/helpers_spec.rb
91
89
  - spec/sections_rails/section_spec.rb
92
90
  - spec/spec_helper.rb
93
91
  homepage: https://github.com/kevgo/sections_rails
@@ -116,6 +114,5 @@ specification_version: 3
116
114
  summary: A rails plugin that allows to define the HTML, CSS, and JS for individual
117
115
  sections of pages as one unit.
118
116
  test_files:
119
- - spec/sections_rails/helpers_spec.rb
120
117
  - spec/sections_rails/section_spec.rb
121
118
  - spec/spec_helper.rb
@@ -1,15 +0,0 @@
1
- module SectionsRails
2
- module Helpers
3
-
4
- # Returns directory and filename portion of the given path.
5
- #
6
- # @param [ String ] paths
7
- # @return [ Array<String, String> ]
8
- def split_path paths
9
- dirname = File.dirname(paths)
10
- dirname = '' if dirname == '.'
11
- [dirname, File.basename(paths)]
12
- end
13
-
14
- end
15
- end
@@ -1,19 +0,0 @@
1
- require 'spec_helper'
2
- include SectionsRails::Helpers
3
-
4
- describe SectionsRails::Helpers do
5
-
6
- describe '#split_path' do
7
- it 'returns the directory and filename of the given path' do
8
- directory, filename = split_path '/one/two/three.js'
9
- directory.should == '/one/two'
10
- filename.should == 'three.js'
11
- end
12
-
13
- it "returns '' if there is no directory" do
14
- directory, filename = split_path 'three.js'
15
- directory.should == ''
16
- filename.should == 'three.js'
17
- end
18
- end
19
- end