rack-disable_css_animations 0.2.0 → 0.4.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
- SHA1:
3
- metadata.gz: e8374de1dbc9db337701d8e37b4c30b1c3e4af0b
4
- data.tar.gz: 7e7f3627e61a3e3f97f3e38d290f3b561f7b13fe
2
+ SHA256:
3
+ metadata.gz: 3f4f052828fc1eef129c74f3265617450794ee647433a6be7e1a424ede568d6e
4
+ data.tar.gz: 550bc940c02d553d40d4864b44750f924073b135d73e4aac7379d8d46350361d
5
5
  SHA512:
6
- metadata.gz: 00c364de5aa92dd3355a04ff74637846a309ac2a5391695ba14365f3ee8eae2b45536923c66ae84a97a9428c201c8f3709192bd766a2f677bcde519484ea31fe
7
- data.tar.gz: 403142445daf4b9fc1b53d910dbea31ff1637169bba3887fdaa6c21649743bac232e4c4bbe2a55a5a230d54c1fe0802f80a6bad3030a3619ba9a5dd633d0bdd6
6
+ metadata.gz: cccb5748d6830a131c60f0d8d350ca8fe3d388e97b07cbe94819dbfea2bc14cf684b39530709c5f5adc2ddfd83919b6c062231942793894b3804b6a835932a71
7
+ data.tar.gz: 51f0f41134048e3fc32865eab28dcf2492b5b09cfe9576fb31bef165a21e8ac109fa063f8028d534e2fff8543f691849d5031c06c8f0de7b8413b396b755cb55
data/.gitignore CHANGED
@@ -3,6 +3,8 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .ruby-version
7
+ .ruby-gemset
6
8
  Gemfile.lock
7
9
  InstalledFiles
8
10
  _yardoc
data/README.md CHANGED
@@ -8,21 +8,9 @@ Add this line to your application's Gemfile:
8
8
 
9
9
  gem 'rack-disable_css_animations'
10
10
 
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself as:
16
-
17
- $ gem install rack-disable_css_animations
18
-
19
11
  ## Usage
20
12
 
21
- If using Rails, add the middleware to your test environment in `config/environments/test.rb`:
22
-
23
- ```ruby
24
- config.middleware.use Rack::DisableCSSAnimations
25
- ```
13
+ If using Rails, this will be automatically added to your middleware stack when required after Rails, so only require it in the environments you want it in.
26
14
 
27
15
  ## Contributing
28
16
 
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
8
+
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class DisableCSSAnimations
3
- VERSION = "0.2.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -2,6 +2,12 @@ require "rack/disable_css_animations/version"
2
2
 
3
3
  module Rack
4
4
  class DisableCSSAnimations
5
+ if defined?(Rails)
6
+ class Rails < Rails::Railtie
7
+ config.app_middleware.use DisableCSSAnimations
8
+ end
9
+ end
10
+
5
11
  def initialize app
6
12
  @app = app
7
13
  end
@@ -29,20 +35,15 @@ module Rack
29
35
  markup = <<-CSS
30
36
  <style>
31
37
  * {
32
- #{with_prefixes "animation-delay: 0s !important;"}
33
- #{with_prefixes "animation-duration: 0.01s !important;"}
34
- #{with_prefixes "transition-delay: 0s !important;"}
35
- #{with_prefixes "transition-duration: 0.01s !important;"}
38
+ animation-delay: 0s !important;
39
+ animation-duration: 0.01s !important;
40
+ transition-delay: 0s !important;
41
+ transition-duration: 0.01s !important;
42
+ scroll-behavior: auto !important;
36
43
  }
37
44
  </style>
38
45
  CSS
39
46
  response.gsub(%r{</head>}, "#{markup}</head>")
40
47
  end
41
-
42
- def with_prefixes rule, prefixes = ["", "-webkit-", "-moz-", "-o-"]
43
- prefixes.map do |prefix|
44
- prefix + rule
45
- end.join("\n")
46
- end
47
48
  end
48
49
  end
@@ -0,0 +1 @@
1
+ require "rack/disable_css_animations"
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "rack"
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.6"
23
+ spec.add_development_dependency "bundler"
24
24
  spec.add_development_dependency "rake"
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-disable_css_animations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2024-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,7 +56,8 @@ description: Rack middleware to disable CSS animations sitewide. Useful for maki
56
56
  acceptance tests quicker and more deterministic.
57
57
  email:
58
58
  - micah@botandrose.com
59
- executables: []
59
+ executables:
60
+ - setup
60
61
  extensions: []
61
62
  extra_rdoc_files: []
62
63
  files:
@@ -65,6 +66,8 @@ files:
65
66
  - LICENSE.txt
66
67
  - README.md
67
68
  - Rakefile
69
+ - bin/setup
70
+ - lib/rack-disable_css_animations.rb
68
71
  - lib/rack/disable_css_animations.rb
69
72
  - lib/rack/disable_css_animations/version.rb
70
73
  - rack-disable_css_animations.gemspec
@@ -87,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
90
  - !ruby/object:Gem::Version
88
91
  version: '0'
89
92
  requirements: []
90
- rubyforge_project:
91
- rubygems_version: 2.4.6
93
+ rubygems_version: 3.2.32
92
94
  signing_key:
93
95
  specification_version: 4
94
96
  summary: Rack middleware to disable CSS animations sitewide.