stylesheet_flipper 0.0.2 → 0.0.3
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/README.md +4 -1
- data/lib/stylesheet_flipper/railtie.rb +7 -2
- data/lib/stylesheet_flipper/version.rb +1 -1
- data/lib/stylesheet_flipper/{helper.rb → view_helpers.rb} +1 -1
- data/lib/stylesheet_flipper.rb +2 -5
- data/spec/units/locales_spec.rb +2 -0
- data/spec/units/{helper_spec.rb → view_helpers_spec.rb} +2 -2
- data/stylesheet_flipper.gemspec +3 -3
- metadata +14 -14
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# StylesheetFlipper
|
2
2
|
|
3
|
-
|
3
|
+
Makes your LTR stylesheet work for RTL locales and vice versa.
|
4
|
+
|
5
|
+
* Flips stylesheets on-the-fly in development mode
|
6
|
+
* Creates flipped versions during asset compilation
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
@@ -1,6 +1,11 @@
|
|
1
|
+
require "stylesheet_flipper/view_helpers"
|
2
|
+
|
1
3
|
module StylesheetFlipper
|
2
|
-
class Railtie <
|
3
|
-
initializer "stylesheet_flipper.
|
4
|
+
class Railtie < Rails::Railtie
|
5
|
+
initializer "stylesheet_flipper.view_helpers" do
|
6
|
+
ActionView::Base.send :include, StylesheetFlipper::ViewHelpers
|
7
|
+
end
|
8
|
+
initializer "stylesheet_flipper.initialize_rails", :group => :all do |app|
|
4
9
|
app.assets.register_bundle_processor 'text/css', :stylesheet_flipper do |context, data|
|
5
10
|
if context.logical_path.include?('-flipped')
|
6
11
|
R2.r2 data
|
data/lib/stylesheet_flipper.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
require "stylesheet_flipper/version"
|
2
|
-
require "stylesheet_flipper/railtie"
|
3
|
-
require "stylesheet_flipper/helper"
|
4
1
|
require "r2"
|
5
|
-
|
6
|
-
|
2
|
+
require "stylesheet_flipper/version"
|
3
|
+
require 'stylesheet_flipper/railtie' if defined?(Rails)
|
data/spec/units/locales_spec.rb
CHANGED
@@ -14,8 +14,10 @@ module StylesheetFlipper
|
|
14
14
|
|
15
15
|
describe "setting locales" do
|
16
16
|
it "should set flipped_locales and normalize values" do
|
17
|
+
flipped_locales = StylesheetFlipper.flipped_locales
|
17
18
|
StylesheetFlipper.flipped_locales = [:da, 'en']
|
18
19
|
StylesheetFlipper.flipped_locales.should == [:da, :en]
|
20
|
+
StylesheetFlipper.flipped_locales = flipped_locales
|
19
21
|
end
|
20
22
|
|
21
23
|
it "should raise argument error if invalid argument" do
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'stylesheet_flipper/
|
2
|
+
require 'stylesheet_flipper/view_helpers'
|
3
3
|
|
4
4
|
module StylesheetFlipper
|
5
5
|
class TestHelper; end
|
6
|
-
StylesheetFlipper::TestHelper.send :include, StylesheetFlipper::
|
6
|
+
StylesheetFlipper::TestHelper.send :include, StylesheetFlipper::ViewHelpers
|
7
7
|
|
8
8
|
describe TestHelper do
|
9
9
|
let(:helper){ TestHelper.new }
|
data/stylesheet_flipper.gemspec
CHANGED
@@ -4,12 +4,12 @@ require File.expand_path('../lib/stylesheet_flipper/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Jeppe Liisberg"]
|
6
6
|
gem.email = ["jeppe@liisberg.net"]
|
7
|
-
gem.description = %q{
|
8
|
-
gem.summary = %q{
|
7
|
+
gem.description = %q{Makes your LTR stylesheet work for RTL locales and vice versa}
|
8
|
+
gem.summary = %q{Makes your LTR stylesheet work for RTL locales and vice versa}
|
9
9
|
gem.homepage = "https://github.com/monibuds/stylesheet_flipper"
|
10
10
|
|
11
11
|
gem.add_development_dependency "rspec"
|
12
|
-
gem.add_runtime_dependency "rails", "~>3.
|
12
|
+
gem.add_runtime_dependency "rails", "~>3.1"
|
13
13
|
gem.add_runtime_dependency "r2"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($\)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stylesheet_flipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70322607235560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,21 +21,21 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70322607235560
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &70322607234820 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '3.
|
32
|
+
version: '3.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70322607234820
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: r2
|
38
|
-
requirement: &
|
38
|
+
requirement: &70322607234020 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,8 +43,8 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
47
|
-
description:
|
46
|
+
version_requirements: *70322607234020
|
47
|
+
description: Makes your LTR stylesheet work for RTL locales and vice versa
|
48
48
|
email:
|
49
49
|
- jeppe@liisberg.net
|
50
50
|
executables: []
|
@@ -57,13 +57,13 @@ files:
|
|
57
57
|
- README.md
|
58
58
|
- Rakefile
|
59
59
|
- lib/stylesheet_flipper.rb
|
60
|
-
- lib/stylesheet_flipper/helper.rb
|
61
60
|
- lib/stylesheet_flipper/locales.rb
|
62
61
|
- lib/stylesheet_flipper/railtie.rb
|
63
62
|
- lib/stylesheet_flipper/version.rb
|
63
|
+
- lib/stylesheet_flipper/view_helpers.rb
|
64
64
|
- spec/spec_helper.rb
|
65
|
-
- spec/units/helper_spec.rb
|
66
65
|
- spec/units/locales_spec.rb
|
66
|
+
- spec/units/view_helpers_spec.rb
|
67
67
|
- stylesheet_flipper.gemspec
|
68
68
|
homepage: https://github.com/monibuds/stylesheet_flipper
|
69
69
|
licenses: []
|
@@ -88,8 +88,8 @@ rubyforge_project:
|
|
88
88
|
rubygems_version: 1.8.10
|
89
89
|
signing_key:
|
90
90
|
specification_version: 3
|
91
|
-
summary:
|
91
|
+
summary: Makes your LTR stylesheet work for RTL locales and vice versa
|
92
92
|
test_files:
|
93
93
|
- spec/spec_helper.rb
|
94
|
-
- spec/units/helper_spec.rb
|
95
94
|
- spec/units/locales_spec.rb
|
95
|
+
- spec/units/view_helpers_spec.rb
|