Skip to content

Commit c4c5de2

Browse files
committed
add cli skeleton
1 parent 9cf208d commit c4c5de2

17 files changed

+226
-4
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
/coverage/
55
/InstalledFiles
66
/pkg/
7-
/spec/reports/
8-
/spec/examples.txt
97
/test/tmp/
108
/test/version_tmp/
119
/tmp/
@@ -54,3 +52,8 @@ build-iPhoneSimulator/
5452

5553
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
5654
# .rubocop-https?--*
55+
56+
# rspec failure tracking
57+
/spec/reports/
58+
/spec/examples.txt
59+
.rspec_status

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--color
3+
--require spec_helper

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
language: ruby
3+
cache: bundler
4+
rvm:
5+
- 2.4.2
6+
before_install: gem install bundler -v 2.1.4

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source "https://rubygems.org"
2+
3+
# Specify your gem's dependencies in weekdone-cli.gemspec
4+
gemspec
5+
6+
gem "rake", "~> 12.0"
7+
gem "rspec", "~> 3.0"

Gemfile.lock

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
PATH
2+
remote: .
3+
specs:
4+
weekdone-cli (0.1.0)
5+
thor
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
diff-lcs (1.4.4)
11+
rake (12.3.3)
12+
rspec (3.9.0)
13+
rspec-core (~> 3.9.0)
14+
rspec-expectations (~> 3.9.0)
15+
rspec-mocks (~> 3.9.0)
16+
rspec-core (3.9.2)
17+
rspec-support (~> 3.9.3)
18+
rspec-expectations (3.9.2)
19+
diff-lcs (>= 1.2.0, < 2.0)
20+
rspec-support (~> 3.9.0)
21+
rspec-mocks (3.9.1)
22+
diff-lcs (>= 1.2.0, < 2.0)
23+
rspec-support (~> 3.9.0)
24+
rspec-support (3.9.3)
25+
thor (1.0.1)
26+
27+
PLATFORMS
28+
ruby
29+
30+
DEPENDENCIES
31+
rake (~> 12.0)
32+
rspec (~> 3.0)
33+
weekdone-cli!
34+
35+
BUNDLED WITH
36+
2.1.4

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 thaim
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
13+
all 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
21+
THE SOFTWARE.

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# weekdone-cli-ruby
2-
cli for weekdone in ruby
1+
# Weekdone CLI
2+
CLI for weekdone
3+
4+
## Installation
5+
6+
Add this line to your application's Gemfile:
7+
8+
```ruby
9+
gem 'weekdone-cli'
10+
```
11+
12+
And then execute:
13+
14+
$ bundle install
15+
16+
Or install it yourself as:
17+
18+
$ gem install weekdone-cli
19+
20+
## Usage
21+
22+
TODO: Write usage instructions here
23+
24+
## Development
25+
26+
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.
27+
28+
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).
29+
30+
## Contributing
31+
32+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/weekdone-cli.
33+
34+
35+
## License
36+
37+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

bin/console

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env ruby
2+
3+
require "bundler/setup"
4+
require "weekdone/cli"
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(__FILE__)

bin/setup

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

exe/weekdone-cli

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env ruby
2+
3+
require "weekdone/cli"
4+
5+
Weekdone::Cli::Command.start

lib/weekdone/cli.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require "weekdone/cli/version"
2+
require "weekdone/cli/command"
3+
4+
module Weekdone
5+
module Cli
6+
class Error < StandardError; end
7+
# Your code goes here...
8+
end
9+
end

lib/weekdone/cli/command.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'thor'
2+
3+
module Weekdone::Cli
4+
class Command < Thor
5+
desc "hello", "Say hello"
6+
def hello
7+
puts "hello"
8+
end
9+
end
10+
end

lib/weekdone/cli/version.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Weekdone
2+
module Cli
3+
VERSION = "0.1.0"
4+
end
5+
end

spec/spec_helper.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require "bundler/setup"
2+
require "weekdone/cli"
3+
4+
RSpec.configure do |config|
5+
# Enable flags like --only-failures and --next-failure
6+
config.example_status_persistence_file_path = ".rspec_status"
7+
8+
# Disable RSpec exposing methods globally on `Module` and `main`
9+
config.disable_monkey_patching!
10+
11+
config.expect_with :rspec do |c|
12+
c.syntax = :expect
13+
end
14+
end

spec/weekdone/cli_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
RSpec.describe Weekdone::Cli do
2+
it "has a version number" do
3+
expect(Weekdone::Cli::VERSION).not_to be nil
4+
end
5+
6+
it "does something useful" do
7+
expect(false).to eq(true)
8+
end
9+
end

weekdone-cli.gemspec

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
require_relative 'lib/weekdone/cli/version'
2+
3+
Gem::Specification.new do |spec|
4+
spec.name = "weekdone-cli"
5+
spec.version = Weekdone::Cli::VERSION
6+
spec.authors = ["thaim"]
7+
spec.email = ["[email protected]"]
8+
9+
spec.summary = "cli for weekdone"
10+
spec.description = "cli for weekdone"
11+
spec.homepage = "https://github.com/thaim/weekdone-cli-ruby"
12+
spec.license = "MIT"
13+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14+
15+
spec.metadata["allowed_push_host"] = "http://mygemserver.com"
16+
17+
spec.metadata["homepage_uri"] = spec.homepage
18+
spec.metadata["source_code_uri"] = spec.homepage
19+
spec.metadata["changelog_uri"] = spec.homepage
20+
21+
# Specify which files should be added to the gem when it is released.
22+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25+
end
26+
spec.bindir = "exe"
27+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28+
spec.require_paths = ["lib"]
29+
30+
spec.add_dependency "thor"
31+
end

0 commit comments

Comments
 (0)