Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 92a55eb

Browse files
committedDec 26, 2012
Added documentation
1 parent 85c5638 commit 92a55eb

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed
 

‎LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1919
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
2020
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2121
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎README.md

+32-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Check::Js
1+
# Browser Details
22

3-
TODO: Write a gem description
3+
Browser Details is a Rack Middleware that logs information about the browser
4+
used to make a request.
5+
6+
When possible this includes whether the browser has Javascript enabled or not.
47

58
## Installation
69

@@ -16,9 +19,34 @@ Or install it yourself as:
1619

1720
$ gem install browser_details
1821

19-
## Usage
22+
### Rails
23+
24+
The middleware will be installed automatically by the Railtie.
25+
26+
To enable Browser Details to report whether the browser has Javascript enabled
27+
for form submissions you must add the following line to your
28+
`app/assets/javascripts/application.js`:
29+
30+
//= require browser_details
31+
32+
Browser Details requires jQuery to be present as it works by checking if the
33+
`utf8` form element has been changed to a large tick from a small tick by the
34+
Browser Details Javascript.
35+
36+
If this script is not added then all browsers will report that Javascript is
37+
disabled.
38+
39+
### Other Rack applications
40+
41+
To use the Browser Details middleware you must add the line:
42+
43+
use BrowserDetails
44+
45+
Wherever it may be appropriate for your application.
2046

21-
TODO: Write usage instructions here
47+
The Javascript detection is currently reliant on Rails. If you would like your
48+
application to be able to detect whether Javascript is enabled too, please
49+
create an issue, or even better open a pull request.
2250

2351
## Contributing
2452

‎browser_details.gemspec

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ require File.expand_path('../lib/browser_details/version', __FILE__)
44
Gem::Specification.new do |gem|
55
gem.authors = ["Garry Shutler"]
66
gem.email = ["garry@robustsoftware.co.uk"]
7-
gem.description = %q{TODO: Write a gem description}
8-
gem.summary = %q{TODO: Write a gem summary}
9-
gem.homepage = ""
7+
gem.description = %q{
8+
Browser Details is a Rack Middleware that logs information about the browser
9+
used to make a request
10+
}
11+
gem.summary = %q{
12+
Browser Details is a Rack Middleware that logs information about the browser
13+
used to make a request
14+
}
15+
gem.homepage = "https://github.com/gshutler/browser_details"
1016

1117
gem.files = Dir.glob(File.join(File.dirname(__FILE__), 'lib', '**', '*'))
1218
gem.name = "browser_details"

0 commit comments

Comments
 (0)