radissh 0.1.0

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: 212d2f775a8ede1e8d62dcbf4c4c882a5affa9c8
4
+ data.tar.gz: 8745ad29284add69264c418feadd3f9f6609f5e1
5
+ SHA512:
6
+ metadata.gz: 3208e65313b6c763ddd4fb1f93079663a076cf9d5bcfdcc933da7d256341e61ee488465751af8af180bc8610c4649134b69667ce7093a1a56096ef370d96d79b
7
+ data.tar.gz: e32dc43c43599ec9449a89d834e802af13768129d0aad551393b661524cbdb71fff3124800df9dedafcfa3ad12ec09c186f045609119753d16d6a78e04bee29e
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2017 Gustavo Motizuki
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Radissh
2
+ Collect and display testimonials from [Radissh.com](https://radissh.com)
3
+
4
+ ## Usage
5
+ This gem is provides a simple helper to render the Radissh widget to display
6
+ testimonials
7
+
8
+ ## Installation
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'radissh'
13
+ ```
14
+
15
+ And then execute:
16
+ ```bash
17
+ $ bundle
18
+ ```
19
+
20
+ Install the initializer file by runnning:
21
+ ```bash
22
+ $ rake radissh:install
23
+ ```
24
+
25
+ Update your API key in the radissh.rb initializer file
26
+ ```ruby
27
+ Radissh.configure do |config|
28
+ config.api_key = 'xxx'
29
+ end
30
+ ```
31
+
32
+ Render the widget by calling the following helper
33
+ ```ruby
34
+ <%= render_radissh %>
35
+ ```
36
+
37
+ or override the api key in case you want to display more than 1 widget per
38
+ website
39
+ ```ruby
40
+ <%= render_radissh 'a-new-api-key' %>
41
+ ```
42
+
43
+ ## Support
44
+ If you have any problem contact us at
45
+ [Radissh.com](https://radissh.com/support)
46
+
47
+ ## License
48
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Radissh'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,3 @@
1
+ Radissh.configure do |config|
2
+ config.api_key = '64f76923d64f14ec17cfe424838b014f'
3
+ end
@@ -0,0 +1,3 @@
1
+ module Radissh
2
+ VERSION = '0.1.0'
3
+ end
data/lib/radissh.rb ADDED
@@ -0,0 +1,32 @@
1
+ module Radissh
2
+ def self.configure
3
+ self.configuration ||= Configuration.new
4
+ yield(configuration)
5
+ end
6
+
7
+ class << self
8
+ attr_accessor :configuration
9
+ end
10
+
11
+ class Configuration
12
+ attr_accessor :api_key
13
+ end
14
+
15
+ def render_radissh(api_key = Radissh.configuration.api_key)
16
+ raw "<div id='radish-app'></div> <script type='text/javascript' charset='utf-8' src='https://radissh.com/initialize_radish?api_key=#{api_key}'></script>"
17
+ end
18
+
19
+ ROOT_PATH = File.expand_path "../../", __FILE__
20
+ # :: before of the module name it is not to encapsulate the module "My Gem"
21
+ module ::Rails
22
+ class Application
23
+ rake_tasks do
24
+ Dir[File.join(ROOT_PATH, "/lib/tasks/", "**/*.rake")].each do |file|
25
+ load file
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ ActiveSupport.on_load(:action_view) { include Radissh }
@@ -0,0 +1,18 @@
1
+ # desc 'Explaining what the task does'
2
+ namespace :radissh do
3
+ task install: :environment do
4
+ source = File.join(Gem.loaded_specs['radissh'].full_gem_path, 'lib', 'initializers', 'radissh.rb')
5
+ target = File.join(Rails.root, 'config', 'initializers', 'radissh.rb')
6
+ if File.exists? target
7
+ puts "#{target} already exists."
8
+ else
9
+ FileUtils.cp_r source, target
10
+ puts "#{target} file created."
11
+ puts 'Create an account at https://radissh.com'
12
+ puts 'Add a new project'
13
+ puts 'Collect testimonials'
14
+ puts 'Update your API KEY at config/initializers/radissh.rb'
15
+ puts 'Use the helper <%= render_radissh %> to display your widget'
16
+ end
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: radissh
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gustavo Motizuki
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Easily embeding testimonials from Radissh into your website
14
+ email:
15
+ - gustavokm90@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - MIT-LICENSE
21
+ - README.md
22
+ - Rakefile
23
+ - lib/initializers/radissh.rb
24
+ - lib/radissh.rb
25
+ - lib/radissh/version.rb
26
+ - lib/tasks/radissh_tasks.rake
27
+ homepage: https://radissh.com
28
+ licenses:
29
+ - MIT
30
+ metadata: {}
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 2.5.1
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: Easily embeding testimonials from Radissh into your website
51
+ test_files: []