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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c4c7cb64fd46f8a9b61174a51346b6323d0027a
4
- data.tar.gz: 23134a4d1f886e6f89b8a78374008eb10b50ecb7
3
+ metadata.gz: 169524ef68ead3a9dac0f1b6330ebdf059963649
4
+ data.tar.gz: e2ed37e01a5e76faf82ff1a151e8e37d69ece406
5
5
  SHA512:
6
- metadata.gz: 6f19da1d845e7e307b7ba19ced74cf88bf2c274d2cc5b6b9ef4f5225e985e3cb883150ee77a62c9b79e1cf86a577430ef3acb3a1204fb61e5d2b706b7b17f9a3
7
- data.tar.gz: e0e7ab96611897d99ae62cd9907ed28b5d42a1b6bd3a167102f4629ba5b1c98c69654dd57552266d556e799bf46131ea97ece52d0190c8225c95ac870d3939d8
6
+ metadata.gz: 3e1fb4943473026c63d0ed9c3376e885336ef3ee5b144eb31f5027912889a88ed1f37dccb3b4fa2c13087f30ad33a8f52ea21cd5203f9544274a569151445dd8
7
+ data.tar.gz: 162c8b7f7dee67f333fecf1c0d528d580155e01c61b264fa435a9f86569448492af8c3058e95821b6c3e0c6147a69e7d3761f9dba1bbd3a15625c5c6372261d8
data/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  # Mirror::Mirror
2
2
 
3
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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
@@ -4,6 +4,8 @@ require "mirror-mirror/sass_patch"
4
4
 
5
5
  module MirrorMirror
6
6
  class << self
7
+ attr_accessor :flipped_by_default
8
+
7
9
  def activate!
8
10
  require 'mirror-mirror/sass_functions'
9
11
  add_to_load_path!
@@ -0,0 +1,4 @@
1
+ require 'mirror-mirror'
2
+
3
+ MirrorMirror.activate!
4
+ MirrorMirror.flipped_by_default = true
@@ -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
- @enabled = true if @options[:custom] && @options[:custom][:mirror_mirror] == true
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
@@ -1,3 +1,3 @@
1
1
  module MirrorMirror
2
- VERSION = "0.9.2"
2
+ VERSION = "0.10.0"
3
3
  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.9.2
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-02-21 00:00:00.000000000 Z
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: '0'
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: '0'
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