xip 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b165aa91b32341a5c6abb27ab2072e4618c67d5c1a112172aaa0faa4e3ca4fe8
4
+ data.tar.gz: d278b9b548252a4cdbd75baa1835b14a2cec9f388a627ff46c355a7dd5918efd
5
+ SHA512:
6
+ metadata.gz: ba7cbafb754fa2f4424705dd9dd5dfab8700835001e6909aee84593e021788f34dad51460962d492e01f1225da429827253d510c6500def568feab4f8754e6aa
7
+ data.tar.gz: bf6245766a9cfdb726a3153e5e4b018a7fadfaad38e521d2142cef776ccacc689d44d866b54cb5a85e31be66e113aaf0bd801df28c78a03a4dc87237dd12d35c
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ gemspec
2
+
3
+ source 'https://rubygems.org'
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ xip (0.0.1)
5
+ redis (>= 4.0.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.3)
11
+ redis (4.2.2)
12
+ rspec (3.8.0)
13
+ rspec-core (~> 3.8.0)
14
+ rspec-expectations (~> 3.8.0)
15
+ rspec-mocks (~> 3.8.0)
16
+ rspec-core (3.8.2)
17
+ rspec-support (~> 3.8.0)
18
+ rspec-expectations (3.8.4)
19
+ diff-lcs (>= 1.2.0, < 2.0)
20
+ rspec-support (~> 3.8.0)
21
+ rspec-mocks (3.8.1)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.8.0)
24
+ rspec-support (3.8.2)
25
+
26
+ PLATFORMS
27
+ ruby
28
+
29
+ DEPENDENCIES
30
+ rspec (= 3.8.0)
31
+ xip!
32
+
33
+ BUNDLED WITH
34
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ Copyright (c) 2020 Moonbase LLC
2
+
3
+ Varsity is an Open Source project licensed under the terms of
4
+ the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
5
+ for license text.
@@ -0,0 +1 @@
1
+ # Xip
data/bin/xip ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/xip/cli'
4
+
5
+ begin
6
+ cli = Xip::CLI.instance
7
+ cli.parse
8
+ cli.run
9
+ rescue => e
10
+ STDERR.puts e.message
11
+ STDERR.puts e.backtrace.join("\n")
12
+ exit 1
13
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'xip/version'
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xip
4
+ class Logger
5
+
6
+ COLORS = ::Hash[
7
+ black: 30,
8
+ red: 31,
9
+ green: 32,
10
+ yellow: 33,
11
+ blue: 34,
12
+ magenta: 35,
13
+ cyan: 36,
14
+ gray: 37,
15
+ light_cyan: 96,
16
+ white: 97
17
+ ].freeze
18
+
19
+ def self.color_code(code)
20
+ COLORS.fetch(code) { raise(ArgumentError, "Color #{code} not supported.") }
21
+ end
22
+
23
+ def self.colorize(input, color:)
24
+ "\e[#{color_code(color)}m#{input}\e[0m"
25
+ end
26
+
27
+ def self.log(topic:, message:)
28
+ puts "#{print_topic(topic)} #{message}"
29
+ end
30
+
31
+ def self.print_topic(topic)
32
+ topic_string = "[#{topic}]"
33
+
34
+ color = case topic.to_sym
35
+ when :primary_session
36
+ :green
37
+ when :previous_session, :back_to_session
38
+ :yellow
39
+ when :facebook, :twilio, :bandwidth
40
+ :blue
41
+ when :smooch
42
+ :magenta
43
+ when :alexa
44
+ :light_cyan
45
+ when :catch_all
46
+ :red
47
+ when :user
48
+ :white
49
+ else
50
+ :gray
51
+ end
52
+
53
+ colorize(topic_string, color: color)
54
+ end
55
+
56
+ class << self
57
+ alias_method :l, :log
58
+ end
59
+
60
+ end
61
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xip
4
+ VERSION = "0.0.1"
5
+ end
@@ -0,0 +1,83 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+
4
+ require 'rspec'
5
+
6
+ RSpec.configure do |config|
7
+ config.expect_with :rspec do |expectations|
8
+ # This option will default to `true` in RSpec 4. It makes the `description`
9
+ # and `failure_message` of custom matchers include text for helper methods
10
+ # defined using `chain`, e.g.:
11
+ # be_bigger_than(2).and_smaller_than(4).description
12
+ # # => "be bigger than 2 and smaller than 4"
13
+ # ...rather than:
14
+ # # => "be bigger than 2"
15
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
16
+ end
17
+
18
+ # rspec-mocks config goes here. You can use an alternate test double
19
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
20
+ config.mock_with :rspec do |mocks|
21
+ # Prevents you from mocking or stubbing a method that does not exist on
22
+ # a real object. This is generally recommended, and will default to
23
+ # `true` in RSpec 4.
24
+ mocks.verify_partial_doubles = true
25
+ end
26
+
27
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
28
+ # have no way to turn it off -- the option exists only for backwards
29
+ # compatibility in RSpec 3). It causes shared context metadata to be
30
+ # inherited by the metadata hash of host groups and examples, rather than
31
+ # triggering implicit auto-inclusion in groups with matching metadata.
32
+ config.shared_context_metadata_behavior = :apply_to_host_groups
33
+
34
+ # The settings below are suggested to provide a good initial experience
35
+ # with RSpec, but feel free to customize to your heart's content.
36
+ =begin
37
+ # This allows you to limit a spec run to individual examples or groups
38
+ # you care about by tagging them with `:focus` metadata. When nothing
39
+ # is tagged with `:focus`, all examples get run. RSpec also provides
40
+ # aliases for `it`, `describe`, and `context` that include `:focus`
41
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
42
+ config.filter_run_when_matching :focus
43
+
44
+ # Allows RSpec to persist some state between runs in order to support
45
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
46
+ # you configure your source control system to ignore this file.
47
+ config.example_status_persistence_file_path = "spec/examples.txt"
48
+
49
+ # Limits the available syntax to the non-monkey patched syntax that is
50
+ # recommended. For more details, see:
51
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
52
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
53
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
54
+ config.disable_monkey_patching!
55
+
56
+ # Many RSpec users commonly either run the entire suite or an individual
57
+ # file, and it's useful to allow more verbose output when running an
58
+ # individual spec file.
59
+ if config.files_to_run.one?
60
+ # Use the documentation formatter for detailed output,
61
+ # unless a formatter has already been configured
62
+ # (e.g. via a command-line flag).
63
+ config.default_formatter = 'doc'
64
+ end
65
+
66
+ # Print the 10 slowest examples and example groups at the
67
+ # end of the spec run, to help surface which specs are running
68
+ # particularly slow.
69
+ config.profile_examples = 10
70
+
71
+ # Run specs in random order to surface order dependencies. If you find an
72
+ # order dependency and want to debug it, you can fix the order by providing
73
+ # the seed, which is printed after each run.
74
+ # --seed 1234
75
+ config.order = :random
76
+
77
+ # Seed global randomization in this process using the `--seed` CLI option.
78
+ # Setting this allows you to use `--seed` to deterministically reproduce
79
+ # test failures related to randomization by passing the same `--seed` value
80
+ # as the one that triggered the failure.
81
+ Kernel.srand config.seed
82
+ =end
83
+ end
@@ -0,0 +1,20 @@
1
+ require_relative "lib/xip/version"
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'xip'
5
+ s.version = Xip::VERSION
6
+ s.summary = 'Xip'
7
+ s.description = 'Ruby bot framework'
8
+ s.authors = ['Mauricio Gomes']
9
+ s.email = 'mauricio@edge14.com'
10
+ s.files = `git ls-files`.split("\n")
11
+ s.homepage = 'http://github.com/themoonbase/xip'
12
+ s.license = 'LGPL-3.0-only'
13
+ s.required_ruby_version = ">= 2.4.0"
14
+ s.executables = ['xip']
15
+
16
+ s.add_dependency 'redis', '>= 4.0.2'
17
+
18
+ s.add_development_dependency 'rspec', '= 3.8.0'
19
+
20
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xip
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mauricio Gomes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: redis
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.8.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.8.0
41
+ description: Ruby bot framework
42
+ email: mauricio@edge14.com
43
+ executables:
44
+ - xip
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - LICENSE
51
+ - README.md
52
+ - bin/xip
53
+ - lib/xip.rb
54
+ - lib/xip/logger.rb
55
+ - lib/xip/version.rb
56
+ - spec/spec_helper.rb
57
+ - xip.gemspec
58
+ homepage: http://github.com/themoonbase/xip
59
+ licenses:
60
+ - LGPL-3.0-only
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 2.4.0
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubygems_version: 3.1.4
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Xip
81
+ test_files: []