markify 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -48,7 +48,7 @@ Install Markify via rubygems:
48
48
 
49
49
  $ crontab -e
50
50
 
51
- @hourly /usr/local/bin/bash -c "/usr/local/bin/markify -s"
51
+ @hourly /usr/local/bin/bash -c "/usr/local/bin/markify -s" 1>/dev/null
52
52
 
53
53
  Possible options to run markify:
54
54
 
@@ -84,4 +84,4 @@ The Markify source code is [hosted on GitHub](https://github.com/meise/markify).
84
84
 
85
85
  ## License
86
86
 
87
- Released under the GNU GENERAL PUBLIC LICENSE Version 3. © Daniel Meißner, 2013
87
+ Released under the GNU GENERAL PUBLIC LICENSE Version 3. © Daniel Meißner, 2013
@@ -63,7 +63,8 @@ module Markify
63
63
  exit 0
64
64
  end
65
65
 
66
- bot = Markify::Bot.new(@config['xmpp']['bot_id'], @config['xmpp']['bot_password']) if @options[:send]
66
+ bot = Markify::Bot.new(@config['xmpp']['bot_id'], @config['xmpp']['bot_password']) if @options[:send] &&
67
+ new_marks.count > 0
67
68
 
68
69
  new_marks.sort_by{|mark| mark.date}.each do |mark|
69
70
  unless @options[:noop]
@@ -20,7 +20,7 @@ along with Markify. If not, see <http://www.gnu.org/licenses/>.
20
20
 
21
21
  module Markify
22
22
 
23
- VERSION = '0.2.1'
23
+ VERSION = '0.2.2'
24
24
  NAME = 'markify'
25
25
 
26
26
  DESCRIPTION =<<DESCRIPTION
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "bundler", "~> 1.3"
27
27
  spec.add_development_dependency "rake"
28
28
  spec.add_development_dependency "pry"
29
- spec.add_development_dependency('rspec', '~> 2.11.0')
29
+ spec.add_development_dependency('rspec', '~> 2.14.0')
30
30
  spec.add_development_dependency('simplecov')
31
31
  end
@@ -0,0 +1,31 @@
1
+ # encoding: utf-8
2
+ =begin
3
+ Copyright Daniel Meißner <meise+markify@3st.be>, 2013
4
+
5
+ This file is part of Markify.
6
+
7
+ Markify is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ Markify is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with Markify. If not, see <http://www.gnu.org/licenses/>.
19
+ =end
20
+
21
+ require 'spec_helper'
22
+
23
+ describe Markify::Bot do
24
+ describe '#initialize' do
25
+ it 'should set xmpp id, password and should connect to xmpp server' do
26
+ expect{
27
+ Markify::Bot.new("foobar", "möp")
28
+ }.to raise_error(SocketError, 'getaddrinfo: Name or service not known')
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,66 @@
1
+ # encoding: UTF-8
2
+ =begin
3
+ Copyright Daniel Meißner <meise+markify@3st.be>, 2013
4
+
5
+ This file is part of Markify.
6
+
7
+ Markify is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ Markify is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with Markify. If not, see <http://www.gnu.org/licenses/>.
19
+ =end
20
+
21
+ require 'spec_helper'
22
+
23
+ describe Markify::Scraper::Base do
24
+
25
+ before(:each) do
26
+ @scraper = Markify::Scraper::Base.new('foobar', 'möp', 'http://foobar.baz')
27
+ end
28
+
29
+ describe '#initialize' do
30
+ it 'should set login name' do
31
+ @scraper.instance_variable_get(:@data)[:login_name].should match 'foobar'
32
+ end
33
+
34
+ it 'should set login password' do
35
+ @scraper.instance_variable_get(:@data)[:login_password].should match 'möp'
36
+ end
37
+
38
+ it 'should set sis login page' do
39
+ @scraper.instance_variable_get(:@data)[:login_page].should match 'http://foobar.baz'
40
+ end
41
+
42
+ it 'should have an empty marks array by default' do
43
+ @scraper.marks.should be_empty
44
+ end
45
+ end
46
+
47
+ describe '@marks' do
48
+ it 'should be not writable from outside' do
49
+ expect {
50
+ @scraper.marks = %w{1 2 3}
51
+ }.to raise_error(NoMethodError)
52
+ end
53
+
54
+ it 'should be readable from outside' do
55
+ @scraper.instance_variable_set(:@marks, %w{23 42})
56
+
57
+ @scraper.marks.count.should eq 2
58
+ @scraper.marks.first.should match /23/
59
+ @scraper.marks.last.should match /42/
60
+ end
61
+
62
+ it 'should be a array' do
63
+ @scraper.instance_variable_get(:@marks).should be_an_instance_of Array
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,27 @@
1
+ # encoding: UTF-8
2
+ =begin
3
+ Copyright Daniel Meißner <meise+markify@3st.be>, 2013
4
+
5
+ This file is part of Markify.
6
+
7
+ Markify is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ Markify is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with Markify. If not, see <http://www.gnu.org/licenses/>.
19
+ =end
20
+
21
+ require 'spec_helper'
22
+
23
+ describe Markify::Scraper::Hbrs do
24
+ before do
25
+ @scraper_hbrs = Markify::Scraper::Hbrs.new("foobar", "möp")
26
+ end
27
+ end
@@ -0,0 +1,52 @@
1
+ # encoding: utf-8
2
+ =begin
3
+ Copyright Daniel Meißner <meise+markify@3st.be>, 2013
4
+
5
+ This file is part of Markify.
6
+
7
+ Markify is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ Markify is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with Markify. If not, see <http://www.gnu.org/licenses/>.
19
+ =end
20
+
21
+ require 'spec_helper'
22
+
23
+ describe Markify do
24
+
25
+ describe 'VERSION constant' do
26
+ it 'should be a version string' do
27
+ Markify::VERSION.is_a?(String).should == true
28
+ end
29
+
30
+ it 'should be consist of three numbers' do
31
+ Markify::VERSION.match(/^(\d+\W)(\d+\W)(\d+)$/).should_not == nil
32
+ end
33
+ end
34
+
35
+ describe 'SUMMARY constant' do
36
+ it 'should be a summary string' do
37
+ Markify::SUMMARY.is_a?(String).should == true
38
+ end
39
+ end
40
+
41
+ describe 'DESCRIPTION constant' do
42
+ it 'should be a description string' do
43
+ Markify::DESCRIPTION.is_a?(String).should == true
44
+ end
45
+ end
46
+
47
+ describe 'NAME constant' do
48
+ it 'should be a name string' do
49
+ Markify::NAME.is_a?(String).should == true
50
+ end
51
+ end
52
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-14 00:00:00.000000000 Z
12
+ date: 2013-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xmpp4r
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 2.11.0
101
+ version: 2.14.0
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 2.11.0
109
+ version: 2.14.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: simplecov
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -158,8 +158,12 @@ files:
158
158
  - lib/markify/settings.rb
159
159
  - lib/markify/version.rb
160
160
  - markify.gemspec
161
+ - spec/markify/bot_spec.rb
161
162
  - spec/markify/database_spec.rb
162
163
  - spec/markify/mark_spec.rb
164
+ - spec/markify/scraper/base_spec.rb
165
+ - spec/markify/scraper/hbrs_spec.rb
166
+ - spec/markify/version_spec.rb
163
167
  - spec/spec_helper.rb
164
168
  homepage: https://github.com/meise/markify
165
169
  licenses:
@@ -187,6 +191,10 @@ signing_key:
187
191
  specification_version: 3
188
192
  summary: Mark notify script for different universities.
189
193
  test_files:
194
+ - spec/markify/bot_spec.rb
190
195
  - spec/markify/database_spec.rb
191
196
  - spec/markify/mark_spec.rb
197
+ - spec/markify/scraper/base_spec.rb
198
+ - spec/markify/scraper/hbrs_spec.rb
199
+ - spec/markify/version_spec.rb
192
200
  - spec/spec_helper.rb