Skip to content

Commit

Permalink
Add check runtime dependences, fix readme and yandex.gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegorov committed Jan 22, 2018
1 parent 1c9ea3e commit 0b22cf9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
Yadisk
======

Tool for download

Command line tool for download file from Yandex.Disk through share link

## Install

```
gem install yadisk
$ gem install yadisk
```

For development:

```
gem install --dev yadisk
$ gem install --dev yadisk
```

## How use

```
# Save to current directory
$ yadisk https://yadi.sk/i/UFD
# Save to other directory
$ yadisk https://yadi.sk/i/UFD /path/to/directory
```

## Test

For run test use:

```
rspec
$ rspec
```

## Contribution
Expand Down
5 changes: 5 additions & 0 deletions bin/yadisk
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/usr/bin/env ruby

# handle ARGV, and execute Yadisk::Main class

require 'yadisk'
require 'yadisk/check_runtime'

Yadisk::CheckRuntime.check_wget
14 changes: 14 additions & 0 deletions lib/yadisk/check_runtime.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "io/console"

module Yadisk
class CheckRuntime
def self.check_wget
output = IO.popen("which wget").read
if output.empty?
puts "Please install wget or add it to 'PATH' and try again\n"
abort
end
end
end
end

7 changes: 4 additions & 3 deletions yadisk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ require_relative 'lib/yadisk/version'

Gem::Specification.new do |s|
s.name = 'yadisk'
s.version = Yadisk::VERSION # '0.0.1'
s.version = Yadisk::VERSION
s.date = '2018-01-25'
s.summary = "Download file from Yandex.Disk through share link"
s.description = "Command line tool for download file from Yandex.Disk through share link"
s.author = "Artem Yegorov"
s.email = '[email protected]'
s.files = ["lib/yadisk.rb", "lib/yadisk/version.rb"]
s.files = ["lib/yadisk.rb", "lib/yadisk/check_runtime.rb", "lib/yadisk/version.rb"]
s.platform = Gem::Platform::RUBY
s.executables << 'yadisk'
s.add_development_dependency 'rspec', '~> 3.7.0'
s.add_development_dependency 'rspec', ['~> 3.7.0', '< 4.0']
s.homepage = 'https://github.com/yegorov/yadisk'
s.license = 'MIT'
end
Expand Down

0 comments on commit 0b22cf9

Please sign in to comment.