mirror-mirror 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -4
- data/lib/mirror-mirror.rb +2 -0
- data/lib/mirror-mirror/activate/flipped.rb +4 -0
- data/lib/mirror-mirror/mirror_visitor.rb +2 -1
- data/lib/mirror-mirror/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 169524ef68ead3a9dac0f1b6330ebdf059963649
|
4
|
+
data.tar.gz: e2ed37e01a5e76faf82ff1a151e8e37d69ece406
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e1fb4943473026c63d0ed9c3376e885336ef3ee5b144eb31f5027912889a88ed1f37dccb3b4fa2c13087f30ad33a8f52ea21cd5203f9544274a569151445dd8
|
7
|
+
data.tar.gz: 162c8b7f7dee67f333fecf1c0d528d580155e01c61b264fa435a9f86569448492af8c3058e95821b6c3e0c6147a69e7d3761f9dba1bbd3a15625c5c6372261d8
|
data/README.md
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# Mirror::Mirror
|
2
2
|
|
3
|
-
|
3
|
+
Performs right-to-left flipping of sass stylesheets using an opt-out
|
4
|
+
strategy. That is, when enabled, all directional properties in CSS are
|
5
|
+
flipped so that the page is as it would be if viewed in a mirror (with
|
6
|
+
the exception of the text characters and images)
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
7
10
|
Add this line to your application's Gemfile:
|
8
11
|
|
9
|
-
gem 'mirror-mirror'
|
12
|
+
gem 'mirror-mirror', :require => 'mirror-mirror/activate'
|
10
13
|
|
11
14
|
And then execute:
|
12
15
|
|
@@ -18,12 +21,31 @@ Or install it yourself as:
|
|
18
21
|
|
19
22
|
## Usage
|
20
23
|
|
21
|
-
|
24
|
+
Because this library patches itself into Sass the normal require of
|
25
|
+
`'mirror-mirror'` simply loads all the ruby code but does not perform
|
26
|
+
any patching. It is expected that ruby libraries will activate the
|
27
|
+
library by calling `MirrorMirror.activate!` if they want the patching to
|
28
|
+
occur.
|
29
|
+
|
30
|
+
However, two special ruby files are available to require instead
|
31
|
+
for the common use cases:
|
32
|
+
|
33
|
+
### Make the MirrorMirror mixins available for import:
|
34
|
+
|
35
|
+
```
|
36
|
+
scss -r mirror-mirror/activate ...
|
37
|
+
```
|
38
|
+
|
39
|
+
### Make flipping happen by default to all files compiled:
|
40
|
+
|
41
|
+
```
|
42
|
+
scss -r mirror-mirror/activate/flipped ...
|
43
|
+
```
|
22
44
|
|
23
45
|
## Contributing
|
24
46
|
|
25
47
|
1. Fork it
|
26
48
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
49
|
+
3. Commit your changes with tests (`git commit -am 'Add some feature'`)
|
28
50
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
51
|
5. Create new Pull Request
|
data/lib/mirror-mirror.rb
CHANGED
@@ -15,7 +15,8 @@ module MirrorMirror
|
|
15
15
|
def visit_root(root_node)
|
16
16
|
# XXX set up defaults from options
|
17
17
|
@options = root_node.options
|
18
|
-
|
18
|
+
custom_opts = @options[:custom] || {}
|
19
|
+
@enabled = !!custom_opts.fetch(:mirror_mirror, MirrorMirror.flipped_by_default)
|
19
20
|
root_node.children = yield
|
20
21
|
root_node
|
21
22
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirror-mirror
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Eppstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - <
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - <
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- README.md
|
65
65
|
- lib/mirror-mirror.rb
|
66
66
|
- lib/mirror-mirror/activate.rb
|
67
|
+
- lib/mirror-mirror/activate/flipped.rb
|
67
68
|
- lib/mirror-mirror/mirror_visitor.rb
|
68
69
|
- lib/mirror-mirror/sass_functions.rb
|
69
70
|
- lib/mirror-mirror/sass_patch.rb
|