nyaa 0.1.1 → 0.1.2

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.
Files changed (5) hide show
  1. data/.travis.yml +5 -0
  2. data/Rakefile +25 -0
  3. data/lib/nyaa.rb +2 -3
  4. data/lib/nyaa/version.rb +1 -1
  5. metadata +3 -1
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
@@ -0,0 +1,25 @@
1
+ require 'rake'
2
+
3
+ gemspec = eval(File.read(Dir["*.gemspec"].first))
4
+
5
+ desc "Validate the gemspec"
6
+ task :gemspec do
7
+ gemspec.validate
8
+ end
9
+
10
+ desc "Build gem locally"
11
+ task :build => :gemspec do
12
+ system "gem build #{gemspec.name}.gemspec"
13
+ FileUtils.mkdir_p "pkg"
14
+ FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
15
+ end
16
+
17
+ desc "Install gem locally"
18
+ task :install => :build do
19
+ system "gem install pkg/#{gemspec.name}-#{gemspec.version}"
20
+ end
21
+
22
+ desc "Clean automatically generated files"
23
+ task :clean do
24
+ FileUtils.rm_rf "pkg"
25
+ end
@@ -105,7 +105,7 @@ class Nyaa
105
105
  f = Formatador.new
106
106
  f.display_line( "\t[yellow]NyaaTorrents >> Browse | Anime, manga, and music[/]\n" )
107
107
 
108
- if data[0].nil?
108
+ if data[0].nil? || results[0].nil?
109
109
  f.display_line( "[normal]No matches found. Try another category. See --help.[/]\n")
110
110
  f.display_line("\t[yellow]Exiting.[/]")
111
111
  exit
@@ -126,7 +126,7 @@ class Nyaa
126
126
  f.display_line( "[#{flag}]#{data.index(item)+1}. #{item[:name]}[/]")
127
127
 
128
128
  f.indent {
129
- f.display_line( "[bold]SE: [green]#{item[:se]}[/] [bold]LE: [red]#{item[:le]}[/] [bold]DLs: [yellow]#{item[:dls]}[/] [bold]Msg: [blue]#{item[:msg]}[/]" )
129
+ f.display_line( "[bold]Size: [purple]#{item[:size]}[/] [bold]SE: [green]#{item[:se]}[/] [bold]LE: [red]#{item[:le]}[/] [bold]DLs: [yellow]#{item[:dls]}[/] [bold]Msg: [blue]#{item[:msg]}[/]" )
130
130
  f.display_line( "[green]#{item[:dl]}[/]" )
131
131
  }
132
132
  end
@@ -163,7 +163,6 @@ class Nyaa
163
163
  @opts[:page] += 1
164
164
  f.indent { f.display_line("[purple][blink_fast]! Loading more results...[/]") }
165
165
  data = harvest(@query, @opts[:page])
166
- @marker = 0
167
166
  part = partition(data, 0, @opts[:size])
168
167
  else
169
168
  part = partition(data, @marker + @opts[:size], @opts[:size])
@@ -1,3 +1,3 @@
1
1
  class Nyaa
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nyaa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -84,8 +84,10 @@ extensions: []
84
84
  extra_rdoc_files: []
85
85
  files:
86
86
  - .gitignore
87
+ - .travis.yml
87
88
  - LICENSE
88
89
  - README.md
90
+ - Rakefile
89
91
  - bin/nyaa
90
92
  - lib/nyaa.rb
91
93
  - lib/nyaa/version.rb