dtake 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ae0177749d6be4b736b8270a89e148ef6199a61
4
- data.tar.gz: 45e92a2e2ffaefe8c6a87153acb718e9d83438bf
3
+ metadata.gz: d020ef20537809b304c4d4575ec95583aa9379bb
4
+ data.tar.gz: 912a30cfdcc2bf976e77b300cb5424be4f80be9b
5
5
  SHA512:
6
- metadata.gz: 5b7dfbaf6e7bdef2512c5f87800f1c1471460ee2969f54cb77cf40c7de07aee10e1ab3e1ae833def0ab870a79a10395bd83ec1a095518570581af97cf650d06a
7
- data.tar.gz: 2f5fe123f48bce7b44b437f6f93f7398ee200ceed1b36124ec3c7a51da46cc635dcf181dc82b01ad03895084bdbabd9562bbf5063c33fb3570349947b7226905
6
+ metadata.gz: 1572bd5feac81b6a9481ce547f014af0c83e45e87b29ffecf9eedc44b2dc283e9e05e8fa5bd558e76e08a25682b0badf14e2adc9cb075c094d15cf6957b5cc7f
7
+ data.tar.gz: 0ceb95e85603bfb328526cfd589006e5fdab7dbc4911a4a7c93fb3649fff94f92ffacadca6edd83fdbe5ece18ce08370508f3a649929714dbff8c7d8c7af95c2
data/README.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # Dtake
2
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/dtake`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Dtake is donwloader of $take files.
4
+ Helps you search and download files easily.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ (This should be useless if you don't know what $take is.)
6
7
 
7
8
  ## Installation
8
9
 
9
- Add this line to your application's Gemfile:
10
+ $ gem install dtake
10
11
 
11
- ```ruby
12
- gem 'dtake'
13
- ```
12
+ ## Usage
14
13
 
15
- And then execute:
16
14
 
17
- $ bundle
15
+ You can get the list of new files at $take.
18
16
 
19
- Or install it yourself as:
17
+ $ dtake ls
20
18
 
21
- $ gem install dtake
19
+ Or you can search files by the name.
22
20
 
23
- ## Usage
21
+ $ dtake f [keyword]
22
+
23
+ If you want something, donwload it.
24
24
 
25
- TODO: Write usage instructions here
25
+ $ dtake d [filename]
26
26
 
27
27
  ## Development
28
28
 
@@ -32,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
32
 
33
33
  ## Contributing
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dtake.
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nehuyu/dtake.
36
36
 
37
37
 
38
38
  ## License
data/exe/dtake CHANGED
@@ -5,4 +5,10 @@ require 'open-uri'
5
5
 
6
6
  require 'dtake'
7
7
 
8
- Dtake::CLI.start
8
+ commands_regexp = /ls|f|find|d/
9
+
10
+ if !ARGV[0] || ARGV[0].match(commands_regexp) #コマンドであればそのままstart
11
+ Dtake::CLI.start
12
+ else
13
+ Dtake::CLI.new.d(ARGV[0]) #コマンド以外はファイル名、ダウンロード
14
+ end
data/lib/dtake/cli.rb CHANGED
@@ -6,9 +6,10 @@ require 'date'
6
6
 
7
7
  module Dtake
8
8
  class CLI < Thor
9
- desc "ls", "show all files on list.html." # コマンドの使用例と、概要
9
+ desc "ls", "show recent files on list.html." # コマンドの使用例と、概要
10
10
  def ls()
11
11
  list_url = "https://web.sfc.keio.ac.jp/~takefuji/list.html"
12
+
12
13
  doc = Nokogiri::HTML(open(list_url))
13
14
  doc.inner_text.split("\n").each do |line|
14
15
  next if (line == "") #空行は無視
@@ -22,7 +23,7 @@ module Dtake
22
23
  end
23
24
  end
24
25
 
25
- desc "d filename", "download file on the server." # コマンドの使用例と、概要
26
+ desc "[d] filename", "download file on the server." # コマンドの使用例と、概要
26
27
  def d(filename)
27
28
  command = "wget https://web.sfc.keio.ac.jp/~takefuji/" + filename
28
29
  system(command)
data/lib/dtake/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dtake
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - nehuyu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-15 00:00:00.000000000 Z
11
+ date: 2017-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler