spark_cli 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: a1f9c59d27c632b13ee77b19d9db45a3c876766d
4
+ data.tar.gz: 85b72ed6a49cb9c9023caa8e97bea261bdf09699
5
+ SHA512:
6
+ metadata.gz: f5d84edf9abf8a17b335af0c7d2acf62fedb56dc084373dd62f418559703bbf302bb79a8af1e66dd0d2357a03562ee4e5a244b9666a03f3039bdf9fe75c08c87
7
+ data.tar.gz: 57fe73847fa1e37290c842bc7383a8d61db65d8248eb969526f46c5c18b0d527822246589c3216fef0a01544f89bf8c3419d2b8708a208709cf980daf4d219b6
data/.gitignore ADDED
@@ -0,0 +1,50 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.4
5
+ before_install: gem install bundler -v 1.13.2
@@ -0,0 +1,61 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Debug Local File",
6
+ "type": "Ruby",
7
+ "request": "launch",
8
+ "cwd": "${workspaceRoot}",
9
+ "program": "${workspaceRoot}/main.rb"
10
+ },
11
+ {
12
+ "name": "Listen for rdebug-ide",
13
+ "type": "Ruby",
14
+ "request": "attach",
15
+ "cwd": "${workspaceRoot}",
16
+ "remoteHost": "127.0.0.1",
17
+ "remotePort": "1234",
18
+ "remoteWorkspaceRoot": "${workspaceRoot}"
19
+ },
20
+ {
21
+ "name": "Rails server",
22
+ "type": "Ruby",
23
+ "request": "launch",
24
+ "cwd": "${workspaceRoot}",
25
+ "program": "${workspaceRoot}/bin/rails",
26
+ "args": [
27
+ "server"
28
+ ]
29
+ },
30
+ {
31
+ "name": "RSpec - all",
32
+ "type": "Ruby",
33
+ "request": "launch",
34
+ "cwd": "${workspaceRoot}",
35
+ "program": "${workspaceRoot}/bin/rspec",
36
+ "args": [
37
+ "-I",
38
+ "${workspaceRoot}"
39
+ ]
40
+ },
41
+ {
42
+ "name": "RSpec - active spec file only",
43
+ "type": "Ruby",
44
+ "request": "launch",
45
+ "cwd": "${workspaceRoot}",
46
+ "program": "${workspaceRoot}/bin/rspec",
47
+ "args": [
48
+ "-I",
49
+ "${workspaceRoot}",
50
+ "${file}"
51
+ ]
52
+ },
53
+ {
54
+ "name": "Cucumber",
55
+ "type": "Ruby",
56
+ "request": "launch",
57
+ "cwd": "${workspaceRoot}",
58
+ "program": "${workspaceRoot}/bin/cucumber"
59
+ }
60
+ ]
61
+ }
@@ -0,0 +1,9 @@
1
+ // Place your settings in this file to overwrite default and user settings.
2
+ {
3
+ "editor.tabSize": 2,
4
+ // Basic settings: turn linter(s) on
5
+ "ruby.lint": {
6
+ "rubocop": true,
7
+ "ruby": true //Runs ruby -wc
8
+ }
9
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "command": "bundle",
3
+ "args": ["exec"],
4
+ "tasks": [
5
+ {
6
+ "suppressTaskName": true,
7
+ "taskName": "test",
8
+ "args": [ "rspec"]
9
+ }
10
+ ]
11
+ }
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in Spark.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,45 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ Spark (0.1.0)
5
+ colored (~> 1.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ colored (1.2)
11
+ diff-lcs (1.2.5)
12
+ docile (1.1.5)
13
+ json (2.0.2)
14
+ rake (10.5.0)
15
+ rspec (3.5.0)
16
+ rspec-core (~> 3.5.0)
17
+ rspec-expectations (~> 3.5.0)
18
+ rspec-mocks (~> 3.5.0)
19
+ rspec-core (3.5.4)
20
+ rspec-support (~> 3.5.0)
21
+ rspec-expectations (3.5.0)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.5.0)
24
+ rspec-mocks (3.5.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.5.0)
27
+ rspec-support (3.5.0)
28
+ simplecov (0.12.0)
29
+ docile (~> 1.1.0)
30
+ json (>= 1.8, < 3)
31
+ simplecov-html (~> 0.10.0)
32
+ simplecov-html (0.10.0)
33
+
34
+ PLATFORMS
35
+ ruby
36
+
37
+ DEPENDENCIES
38
+ Spark!
39
+ bundler (~> 1.13)
40
+ rake (~> 10.0)
41
+ rspec (~> 3.0)
42
+ simplecov
43
+
44
+ BUNDLED WITH
45
+ 1.13.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Chris Jimenez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Spark
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/Spark`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'Spark'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install Spark
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Spark.
36
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/Spark.gemspec ADDED
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'Spark/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "spark_cli"
8
+ spec.version = Spark::VERSION
9
+ spec.authors = ["Chris Jimenez"]
10
+ spec.email = ["cjimenez16@gmail.com"]
11
+
12
+ spec.summary = "An Easy to use CLI logger module"
13
+ spec.description = "Spark is an easy to use CLI logger module that logs in color."
14
+ spec.homepage = "https://github.com/PiXeL16/Spark"
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_runtime_dependency "colored", '~> 1.2'
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.13"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rspec", "~> 3.0"
29
+ spec.add_development_dependency "simplecov", "~> 0.12.0"
30
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "Spark"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ module Spark
2
+ VERSION = "0.1.0"
3
+ end
data/lib/Spark.rb ADDED
@@ -0,0 +1,66 @@
1
+ require 'Spark/version'
2
+ require 'colored'
3
+ require 'logger'
4
+
5
+ module Spark
6
+ # Spark logger functionality
7
+ class Spark
8
+ # returns the medium on where to print the error
9
+ attr_reader :out
10
+ attr_reader :verbose
11
+ # Initialize with default stdout output and verbose false
12
+ def initialize(out: $stdout, verbose: false)
13
+ @out = out
14
+ @verbose = verbose
15
+ end
16
+
17
+ # Gets the logging object
18
+ def log
19
+ out.sync = true
20
+ @log ||= Logger.new(out)
21
+
22
+ @log.formatter = proc do |severity, datetime, progname, msg|
23
+ if verbose
24
+ string = "#{severity} [#{datetime.strftime('%Y-%m-%d %H:%M:%S.%2N')}]: "
25
+ else
26
+ string = "[#{datetime.strftime('%H:%M:%S')}]: "
27
+ end
28
+
29
+ string += "#{msg}\n"
30
+
31
+ string
32
+ end
33
+ @log
34
+ end
35
+
36
+ # Shows an error message
37
+ def error(message)
38
+ log.error(message.to_s.red)
39
+ end
40
+
41
+ # Show an important message in upper case
42
+ def important(message)
43
+ log.warn(message.to_s.upcase.magenta)
44
+ end
45
+
46
+ # Shows a warning message
47
+ def warning(message)
48
+ log.warn(message.to_s.yellow)
49
+ end
50
+
51
+ # Shows a success message
52
+ def success(message)
53
+ log.info(message.to_s.green)
54
+ end
55
+
56
+ # Shows an info message
57
+ def info(message)
58
+ log.info(message.to_s.blue)
59
+ end
60
+
61
+ # Shows a regular message
62
+ def message(message)
63
+ log.info(message.to_s)
64
+ end
65
+ end
66
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spark_cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Chris Jimenez
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-10-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colored
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.13'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.13'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.12.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.12.0
83
+ description: Spark is an easy to use CLI logger module that logs in color.
84
+ email:
85
+ - cjimenez16@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
+ - ".vscode/launch.json"
94
+ - ".vscode/settings.json"
95
+ - ".vscode/tasks.json"
96
+ - Gemfile
97
+ - Gemfile.lock
98
+ - LICENSE
99
+ - README.md
100
+ - Rakefile
101
+ - Spark.gemspec
102
+ - bin/console
103
+ - bin/setup
104
+ - lib/Spark.rb
105
+ - lib/Spark/version.rb
106
+ homepage: https://github.com/PiXeL16/Spark
107
+ licenses:
108
+ - MIT
109
+ metadata: {}
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ requirements: []
125
+ rubyforge_project:
126
+ rubygems_version: 2.6.7
127
+ signing_key:
128
+ specification_version: 4
129
+ summary: An Easy to use CLI logger module
130
+ test_files: []