-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
109 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,51 @@ | ||
version: 2 | ||
version: 2.1 | ||
|
||
orbs: | ||
ruby-orbs: sue445/ruby-orbs@volatile | ||
|
||
jobs: | ||
ruby-2.6: &template | ||
ruby-3-1: &template | ||
docker: | ||
- image: circleci/ruby:2.6 | ||
environment: | ||
BUNDLER_VERSION: 2.0.1 | ||
working_directory: ~/talkable-ruby | ||
- image: cimg/ruby:3.1 | ||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Configure Bundler | ||
command: gem install bundler | ||
|
||
- run: | ||
name: Display Versions | ||
command: | | ||
function extract_version() { perl -pe 'if(($v)=/([0-9]+([.][0-9]+)+)/){print"$v\n";exit}$_=""' ; } | ||
echo Ruby $(ruby --version | extract_version) | ||
echo RubyGems $(gem --version | extract_version) | ||
echo Bundler $(bundle --version | extract_version) | ||
function extractVersion() { | ||
perl -pe 'if(($v)=/([0-9]+([.][0-9]+)+)/){print"$v\n";exit}$_=""' | ||
} | ||
- run: | ||
name: Bundle Install | ||
command: bundle install | ||
echo Ruby $(ruby --version | extractVersion) | ||
echo RubyGems $(gem --version | extractVersion) | ||
echo Bundler $(bundle --version | extractVersion) | ||
- ruby-orbs/bundle-install: | ||
restore_bundled_with: false | ||
with_gemfile_lock: false | ||
gemspec_name: talkable | ||
|
||
- run: | ||
name: RSpec | ||
command: bundle exec rspec | ||
ruby-2.5: | ||
ruby-3-0: | ||
<<: *template | ||
docker: | ||
- image: circleci/ruby:2.5 | ||
ruby-2.4: | ||
- image: cimg/ruby:3.0 | ||
ruby-2-7: | ||
<<: *template | ||
docker: | ||
- image: circleci/ruby:2.4 | ||
ruby-2.3: | ||
- image: cimg/ruby:2.7 | ||
ruby-2-6: | ||
<<: *template | ||
docker: | ||
- image: circleci/ruby:2.3 | ||
- image: cimg/ruby:2.6 | ||
|
||
workflows: | ||
version: 2 | ||
workflow: | ||
jobs: | ||
- ruby-2.6 | ||
- ruby-2.5 | ||
- ruby-2.4 | ||
- ruby-2.3 | ||
- ruby-3-1 | ||
- ruby-3-0 | ||
- ruby-2-7 | ||
- ruby-2-6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class ErbSyntaxChecker | ||
def initialize(erb_text) | ||
@erb_text = erb_text | ||
end | ||
|
||
def correct_syntax? | ||
render { "" }.result | ||
true | ||
rescue NameError | ||
true | ||
rescue SyntaxError | ||
false | ||
end | ||
|
||
private def render | ||
ERB.new(@erb_text).result(binding) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
$:.push File.expand_path('../lib', __FILE__) | ||
require 'talkable/version' | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "talkable" | ||
s.version = Talkable::VERSION | ||
s.authors = ["Talkable"] | ||
s.email = "[email protected]" | ||
s.description = "Talkable Ruby Gem to make your own referral program in Sinatra or Rails application" | ||
s.summary = "Talkable Referral Program API" | ||
s.homepage = "https://github.com/talkable/talkable-ruby" | ||
s.license = "MIT" | ||
|
||
s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
s.require_paths = ["lib"] | ||
|
||
s.required_ruby_version = ">= 2.3.0" # min ruby version that still receives security updates | ||
|
||
s.add_dependency "rack", ">= 1.6.1" | ||
s.add_dependency "furi", "~> 0.2" | ||
s.add_dependency "hashie", "~> 3.4" | ||
|
||
s.add_development_dependency "bundler", "~> 2.0.1" | ||
s.add_development_dependency "rake", "~> 11.2" | ||
s.add_development_dependency "rspec", "~> 3.4" | ||
s.add_development_dependency "simplecov", "~> 0.12" | ||
s.add_development_dependency "webmock", ">= 2.1" | ||
|
||
s.add_development_dependency "ammeter" # specs for generators | ||
s.add_development_dependency "haml" # check haml syntax in generators | ||
# frozen_string_literal: true | ||
|
||
require_relative "lib/talkable/version" | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "talkable" | ||
spec.version = Talkable::VERSION | ||
spec.authors = ["Talkable"] | ||
spec.email = "[email protected]" | ||
spec.description = "Talkable Ruby Gem to make your own referral program in Sinatra or Rails application" | ||
spec.license = "MIT" | ||
|
||
spec.summary = "Talkable Referral Program API" | ||
spec.homepage = "https://github.com/talkable/talkable-ruby" | ||
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0") | ||
|
||
spec.metadata = { | ||
"homepage_uri" => spec.homepage, | ||
"bug_tracker_uri" => "#{spec.homepage}/issues", | ||
"changelog_uri" => "#{spec.homepage}/releases/tag/v#{spec.version}", | ||
"source_code_uri" => "#{spec.homepage}/tree/v#{spec.version}", | ||
"allowed_push_host" => "https://rubygems.org", | ||
"rubygems_mfa_required" => "true", | ||
} | ||
|
||
spec.files = Dir.chdir(File.expand_path(__dir__)) do | ||
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) } | ||
end | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_dependency "rack", "~> 2.2" | ||
spec.add_dependency "furi", "~> 0.2" | ||
spec.add_dependency "hashie", "~> 5.0" | ||
|
||
spec.add_development_dependency "rake", ">= 13.0" | ||
spec.add_development_dependency "rspec", ["~> 3", "< 3.11"] | ||
spec.add_development_dependency "simplecov", "~> 0.21" | ||
spec.add_development_dependency "webmock", "~> 3.14" | ||
|
||
spec.add_development_dependency "ammeter" # specs for generators | ||
spec.add_development_dependency "haml" # check haml syntax in generators | ||
end |