seiya 0.0.8.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc2671f82eebb317f6b3d112cc8ac5f273d549d4
4
- data.tar.gz: d1d21054966dbe39c9e13ecdd897462221ac9faa
3
+ metadata.gz: fae08f218ed9e2838b70bb5ec6936f9dffc3381a
4
+ data.tar.gz: 1fac2811746a3824070e7d767912c3b0d325a7b1
5
5
  SHA512:
6
- metadata.gz: 7f73547ed9ce03343f28eaa2b415a187d5a489f805833cb17a2f447b54eeae4a2a48192b4e6beaae803e8693631fd1835bd9462d378aba416006b1971917a94c
7
- data.tar.gz: 4c306a1743be6d3bbdb2cbb3c3014cf2abd3c6e6181a0e0a8cb4c041ed2091e3558901e6e6464d54f423342fc6b94e5316c1ef5b9740c1c088fa9d1ae3461367
6
+ metadata.gz: 189851a1172ea754570ddecba470bb14cb595810d19317d6506894716f628fc40ed63bf9933330d2fed7dd060ecd26d956e6e4e2d355ccac28716311d13eaede
7
+ data.tar.gz: 9e62356aac7b9a908b911d838acbb284a8387082d422dbf63394c3e193eef87a49c312eb4bc2a231246cabfbd00c6aacedc82869d5080826401d76015f25a5bf
data/lib/seiya.rb CHANGED
@@ -11,9 +11,10 @@ require 'seiya/settings'
11
11
  require 'seiya/command'
12
12
  require 'seiya/support'
13
13
  require 'seiya/processer'
14
+ require 'seiya/contrib'
14
15
 
15
16
  module Seiya
16
- extend self
17
+ module_function
17
18
 
18
19
  def get_const!(require_str, const_str)
19
20
  begin
@@ -33,6 +34,9 @@ module Seiya
33
34
  end
34
35
 
35
36
  def get_const(require_str, const_str)
37
+ if const_str.nil?
38
+ return Util.get_const require_str
39
+ end
36
40
  require require_str
37
41
  Util.get_const const_str
38
42
  end
@@ -1,4 +1,6 @@
1
1
  module Seiya
2
+ module_function
3
+
2
4
  def process_item(item)
3
5
  @pipelines.each do |p|
4
6
  item = p.process_item item
@@ -1,10 +1,10 @@
1
1
  module Seiya
2
2
  module Settings
3
3
  PIPELINES = {
4
- 'seiya/contrib|Seiya::Contrib::Pipelines::BasePipeline' => 0
4
+ 'Seiya::Contrib::Pipelines::BasePipeline' => 0
5
5
  }
6
6
  REQUEST_MIDDLEWARES = {
7
- 'seiya/contrib|Seiya::Contrib::RequestMiddlewares::RandomUserAgentMiddleware' => 0
7
+ 'Seiya::Contrib::RequestMiddlewares::RandomUserAgentMiddleware' => 0
8
8
  }
9
9
  COMMANDS = 'seiya/contrib|Seiya::Contrib::Commands'
10
10
  USER_AGENTS = [
data/lib/seiya/util.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'facter'
2
+
1
3
  module Seiya
2
4
  module Util
3
5
  extend self
@@ -35,7 +37,7 @@ module Seiya
35
37
  end
36
38
 
37
39
  def num_processors
38
- IO.readlines('/proc/cpuinfo').delete_if { |x| x.index('processor') == nil }.length
40
+ Facter.value('processors')['count']
39
41
  end
40
42
 
41
43
  def num_free_processors
data/lib/seiya/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Seiya
2
- VERSION = '0.0.8.1'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -1 +1 @@
1
- require_relative './commands/sing'
1
+ require_relative 'commands/sing'
@@ -1,6 +1,7 @@
1
1
  require 'seiya'
2
+
2
3
  module Commands
3
- class Sing <Seiya::Command
4
+ class Sing < Seiya::Command
4
5
  def run
5
6
  puts 'I am a singer!'
6
7
  end
@@ -1 +1 @@
1
- require 'tasks/test'
1
+ require_relative 'tasks/test'
@@ -9,7 +9,7 @@ module Tasks
9
9
  'http://www.baidu.com/?key=' << w
10
10
  end
11
11
  end
12
-
12
+
13
13
  def parse(response, enum)
14
14
  item = Items::Test.new
15
15
  item[:url] = response.url
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seiya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yetone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-11 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: i@yetone.net
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 2.4.5
72
+ rubygems_version: 2.4.6
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: A ruby spider like scrapy-python