bbc-a11y 0.0.11 → 0.0.12

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: 8697bc18c43d39bd843b0dfe9fda7a20ea761fc4
4
- data.tar.gz: 4e709fc1f14853e37d2d00ed0453de4db887829a
3
+ metadata.gz: d8df36f88dadb635f0d2de52661d26fcce169ecf
4
+ data.tar.gz: 9260e8f08cf9846a400900516cf63c8fe789920b
5
5
  SHA512:
6
- metadata.gz: 29063edb07ab6454f23b5a0b797e911e278b74ecb7bf4299e64700c8ab16f6c86508829727343fe7f35ded04f354ee9f1a61e4bce18d5ebdada70316c3f30541
7
- data.tar.gz: a0da88c1f3e550ac193b7d9b87a15c00b8135d42dda11e76a809d0750831d28f32f969c147bf5c43e3ddc3b207399d57af21b589c13e0e22edf1f6dda8c09dfc
6
+ metadata.gz: b580f97a7dc87d151d4693e259d62b050b4d5c087ff6d485a390daad502f04ef82aabfc648a95c2b941774c2a0dc35348ca89c0759ec578114fe64838b68c800
7
+ data.tar.gz: 39ee8ec689f4bae55ab38261388f2a0e672ffe1f78815eb6cddd0a4acc792240a1783db15dd93a97732105f1446cdb579c39940b93958cf67bb0b863f3505e01
data/README.md CHANGED
@@ -29,7 +29,7 @@ Now install the gem:
29
29
 
30
30
  ## Configuration
31
31
 
32
- You'll need to configure a11y with a set of URLs to run the checks against. Create a file `.a11y.rb` in the root of your project that looks something like this:
32
+ You'll need to configure a11y with a set of URLs to run the checks against. Create a file `a11y.rb` in the root of your project that looks something like this:
33
33
 
34
34
  ```
35
35
  BBC::A11y.configure do
@@ -56,9 +56,9 @@ A11y will skip any scenarios from the specifications whose name contains that st
56
56
 
57
57
  ## Running it
58
58
 
59
- Once you're configured, you can run the tests using the `a11y` command, from the directory where your `.a11y.rb` configuration file is stored:
59
+ Once you're configured, you can run the tests using the `a11y` command, from the directory where your `a11y.rb` configuration file is stored:
60
60
 
61
61
  bundle exec a11y
62
62
 
63
- This will pick up your `.a11y.rb` configuration file and run the a11y features on each page specified in your configuration.
63
+ This will pick up your `a11y.rb` configuration file and run the a11y checks on each page specified in your configuration.
64
64
  Output is printed to the console.
File without changes
@@ -1,5 +1,17 @@
1
1
  module BBC
2
2
  module A11y
3
3
  TestsFailed = Class.new(StandardError)
4
+
5
+ def self.current_version
6
+ @current_version ||= File.read(File.dirname(__FILE__) + '/a11y/version')
7
+ end
8
+
9
+ def self.until_version(max_version)
10
+ if current_version >= max_version
11
+ raise "DEAD CODE: #{caller[0]}"
12
+ end
13
+ yield
14
+ end
15
+
4
16
  end
5
17
  end
@@ -20,19 +20,17 @@ module BBC
20
20
  rescue TestsFailed
21
21
  exit 1
22
22
  rescue MissingArgument => error
23
- stderr.puts "You missed an argument: #{error.message}"
24
- stderr.puts HELP
25
- raise SystemExit
23
+ exit_with_message "You missed an argument: #{error.message}", HELP
26
24
  end
27
25
 
28
26
  private
29
27
 
30
28
  def settings
31
- if a11y_args.any?
32
- Configuration.for_urls(a11y_args)
33
- else
34
- Configuration.parse(File.expand_path(".a11y.rb"))
29
+ return Configuration.for_urls(a11y_args) if a11y_args.any?
30
+ A11y.until_version('0.1.0') do
31
+ exit_with_message "Please rename your .a11y.rb configuration file to a11y.rb" if File.exist?(".a11y.rb")
35
32
  end
33
+ Configuration.parse(File.expand_path("a11y.rb"))
36
34
  end
37
35
 
38
36
  def a11y_args
@@ -56,6 +54,11 @@ module BBC
56
54
  end
57
55
  end
58
56
 
57
+ def exit_with_message(*messages)
58
+ messages.each { |message| puts message }
59
+ raise SystemExit
60
+ end
61
+
59
62
  attr_reader :stdin, :stderr, :stdout, :args
60
63
  private :stdin, :stderr, :stdout, :args
61
64
 
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbc-a11y
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wynne
@@ -167,12 +167,12 @@ files:
167
167
  - Rakefile
168
168
  - bbc-a11y.gemspec
169
169
  - bin/a11y
170
- - examples/bbc-pages/.a11y.rb
171
170
  - examples/bbc-pages/Gemfile
172
171
  - examples/bbc-pages/Rakefile
173
- - examples/local-web-app/.a11y.rb
172
+ - examples/bbc-pages/a11y.rb
174
173
  - examples/local-web-app/Gemfile
175
174
  - examples/local-web-app/Rakefile
175
+ - examples/local-web-app/a11y.rb
176
176
  - examples/local-web-app/config.ru
177
177
  - examples/local-web-app/public/missing_header.html
178
178
  - examples/local-web-app/public/perfect.html
@@ -258,7 +258,7 @@ rubyforge_project:
258
258
  rubygems_version: 2.2.2
259
259
  signing_key:
260
260
  specification_version: 4
261
- summary: bbc-a11y-0.0.11
261
+ summary: bbc-a11y-0.0.12
262
262
  test_files:
263
263
  - features/README.md
264
264
  - features/exit_status.feature