bothersme_list 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6cf8537a4e0b22a10c739916b91b93aa979ad0f2
4
+ data.tar.gz: ded5e7d892a90f4d896dee4d745e5bbc3f9bb757
5
+ SHA512:
6
+ metadata.gz: 0db4d4209d842475eadd4738825934287543c77fdb0cb4a2aee4b716624186f2cb10ef0c5ae206bba9711733b1b139f0da00985dc465cea8aafb9acff801d824
7
+ data.tar.gz: 28903bc465dda748a2f9c40a82cf158cff0751a9855f7204ef763a9476ab05020897c1ea9a81c5f3b9a30e5af246caf99bcdbf2fdf8d5a6d4a2e6e45edd85845
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## v0.0.1
2
+
3
+ * Initial release
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bothersme_list.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Bothers.Me
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ 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.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # BothersmeList
2
+
3
+ Inserts "Track an Issue" button on a side
4
+
5
+ Parameters:
6
+ 1. type: 'website', 'camera', 'wearable'
7
+ 2. company: 'YourCompanyName'
8
+ 3. product: 'YourProductName' or nil if used for all products
9
+
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'bothersme_list'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install bothersme_list
26
+
27
+ ## Usage
28
+
29
+ At the end of your layout (usually application.hmtl.erb file) before ```</body>``` add
30
+ ```ruby
31
+ <%= issues_list('website', 'MyWebsite.com', 'MyProduct') %>
32
+ ```
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork it ( https://github.com/BothersMe/bothersme_list/fork )
37
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 4. Push to the branch (`git push origin my-new-feature`)
40
+ 5. Create a new Pull Request
41
+
42
+ ## CHANGELOG
43
+
44
+ See [here](CHANGELOG.md).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bothersme_list/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bothersme_list"
8
+ spec.version = BothersmeList::VERSION
9
+ spec.authors = ["Bothers.Me"]
10
+ spec.email = ["artem+gem@bothers.me"]
11
+ spec.summary = %q{Inserts 'Report an Issue' button}
12
+ spec.description = %q{Adds 'Report an Issue' button to your website to allow reporting issues published on bothers.me}
13
+ spec.homepage = "http://bothers.me"
14
+ spec.license = "MIT"
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+ spec.rubyforge_project = "bothersme_list"
20
+ spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "rspec"
23
+ end
@@ -0,0 +1,3 @@
1
+ module BothersmeList
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,40 @@
1
+ require "bothersme_list/version"
2
+
3
+ module BothersmeList
4
+ # Inserts "Track an Issue" button on a side
5
+ #
6
+ # Parameters:
7
+ # type: 'website', 'camera', 'wearable'
8
+ # company: 'YourCompanyName'
9
+ # product: 'YourProductName' or nil if used for all products
10
+ #
11
+ def issues_list(type, company, product=nil, side='right', textColor='white', bgColor='#55B055')
12
+ %{
13
+ <!-- Bothers.Me button -->
14
+ <script>
15
+ (function(w,d,fn,params) {
16
+ if(w[fn]) {
17
+ w[fn]();
18
+ } else {
19
+ w[fn] = w[fn] || function() { ( w[fn].q = w[fn].q||[] ).push(arguments); };
20
+ var script = d.createElement('script');
21
+ var parent = d.getElementsByTagName('script')[0];
22
+ script.async = 1;
23
+ script.src = '//<%= domain_root %>/bm_track_issue/bm_track_issue-v1.js';
24
+ script.setAttribute('fn',fn);
25
+ script.setAttribute('params',JSON.stringify(params));
26
+ parent.parentNode.insertBefore(script, parent);
27
+ }
28
+ })(window, document, 'BMTrackIssue',
29
+ {'side': '#{side}', 'textColor': '#{textColor}', 'bgColor': '#{bgColor}',
30
+ 'data': {
31
+ 'type': '#{type}',
32
+ 'company': '#{company}',
33
+ 'product': '#{product}',
34
+ 'user': '' }});
35
+ </script>
36
+ }
37
+ end
38
+ end
39
+
40
+ ActionView::Base.send :include, BothersmeList if defined?(Rails)
@@ -0,0 +1,18 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+
4
+ describe BothersmeList do
5
+ describe ".issues_list" do
6
+ let(:test_instance) { (Class.new { include BothersmeList }).new }
7
+
8
+ it "should include type" do
9
+ expect(test_instance.issues_list("zzzz", "a", "b")).to include("zzzz")
10
+ end
11
+ it "should include company" do
12
+ expect(test_instance.issues_list("a", "zzzz", "b")).to include("zzzz")
13
+ end
14
+ it "should include product" do
15
+ expect(test_instance.issues_list("a", "b", "zzzz")).to include("zzzz")
16
+ end
17
+ end
18
+ end
@@ -0,0 +1 @@
1
+ require 'bothersme_list'
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bothersme_list
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Bothers.Me
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Adds 'Report an Issue' button to your website to allow reporting issues
56
+ published on bothers.me
57
+ email:
58
+ - artem+gem@bothers.me
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - CHANGELOG.md
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bothersme_list.gemspec
70
+ - lib/bothersme_list.rb
71
+ - lib/bothersme_list/version.rb
72
+ - spec/bothersme_list_spec.rb
73
+ - spec/spec_helper.rb
74
+ homepage: http://bothers.me
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project: bothersme_list
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Inserts 'Report an Issue' button
98
+ test_files:
99
+ - spec/bothersme_list_spec.rb
100
+ - spec/spec_helper.rb