ayadn 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ayadn/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Ayadn
3
- VERSION = "1.4.2"
3
+ VERSION = "1.4.3"
4
4
  end
data/lib/ayadn/view.rb CHANGED
@@ -81,7 +81,9 @@ module Ayadn
81
81
  t.title = "Current Ayadn settings".color(:cyan)
82
82
  t.headings = [ "Category".color(:red), "Parameter".color(:red), "Value(s)".color(:red) ]
83
83
  @iter = 0
84
- Settings.options.each do |k,v|
84
+ opts = Settings.options.dup
85
+ opts.each do |k,v|
86
+ v.delete_if {|ke,_| ke == :deleted || ke == :annotations } # not mutable values
85
87
  v.each do |x,y|
86
88
  t << :separator if @iter >= 1
87
89
  unless y.is_a?(Hash)
@@ -95,6 +97,7 @@ module Ayadn
95
97
  end
96
98
  end
97
99
  end
100
+ clear_screen()
98
101
  puts table
99
102
  end
100
103
 
data/lib/ayadn.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require_relative 'ayadn/version'
3
3
 
4
- %w{rest_client json thor rainbow/ext/string terminal-table yaml logger daybreak fileutils io/console unicode_utils/char_type}.each { |r| require "#{r}" }
4
+ %w{rest_client json thor rainbow/ext/string terminal-table yaml logger daybreak fileutils io/console unicode_utils/char_type readline}.each { |r| require "#{r}" }
5
5
 
6
6
  # winPlatforms = ['mswin', 'mingw', 'mingw_18', 'mingw_19', 'mingw_20', 'mingw32']
7
7
  # case Gem::Platform.local.os
data/spec/spec_helper.rb CHANGED
@@ -4,7 +4,7 @@ require 'ayadn'
4
4
  #require 'fakefs/spec_helpers'
5
5
 
6
6
  RSpec.configure do |config|
7
- config.treat_symbols_as_metadata_keys_with_true_values = true
7
+ # config.treat_symbols_as_metadata_keys_with_true_values = true
8
8
  config.run_all_when_everything_filtered = true
9
9
  config.filter_run :focus
10
10
  # Run specs in random order to surface order dependencies. If you find an
@@ -54,37 +54,37 @@ describe Ayadn::BlacklistWorkers do
54
54
  k = Ayadn::BlacklistWorkers.new
55
55
  k.add(['client', 'IFTTT'])
56
56
  expect(Ayadn::Databases.blacklist['ifttt']).to eq :client
57
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"IFTTT\"]' to blacklist of clients."
57
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"IFTTT\"]' to blacklist of clients."
58
58
  end
59
59
  it "adds a client to the blacklist" do
60
60
  k = Ayadn::BlacklistWorkers.new
61
61
  k.add(['source', 'Zapier'])
62
62
  expect(Ayadn::Databases.blacklist['zapier']).to eq :client
63
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"Zapier\"]' to blacklist of clients."
63
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"Zapier\"]' to blacklist of clients."
64
64
  end
65
65
  it "adds a hashtag to the blacklist" do
66
66
  k = Ayadn::BlacklistWorkers.new
67
67
  k.add(['hashtag', 'Sports'])
68
68
  expect(Ayadn::Databases.blacklist['sports']).to eq :hashtag
69
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"Sports\"]' to blacklist of hashtags."
69
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"Sports\"]' to blacklist of hashtags."
70
70
  end
71
71
  it "adds a hashtag to the blacklist" do
72
72
  k = Ayadn::BlacklistWorkers.new
73
73
  k.add(['tag', 'tv'])
74
74
  expect(Ayadn::Databases.blacklist['tv']).to eq :hashtag
75
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"tv\"]' to blacklist of hashtags."
75
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"tv\"]' to blacklist of hashtags."
76
76
  end
77
77
  it "adds a mention to the blacklist" do
78
78
  k = Ayadn::BlacklistWorkers.new
79
79
  k.add(['mention', 'mrTest'])
80
80
  expect(Ayadn::Databases.blacklist['@mrtest']).to eq :mention
81
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"@mrTest\"]' to blacklist of mentions."
81
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"@mrTest\"]' to blacklist of mentions."
82
82
  end
83
83
  it "adds a mention to the blacklist" do
84
84
  k = Ayadn::BlacklistWorkers.new
85
85
  k.add(['mentions', 'yolo'])
86
86
  expect(Ayadn::Databases.blacklist['@yolo']).to eq :mention
87
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"@yolo\"]' to blacklist of mentions."
87
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"@yolo\"]' to blacklist of mentions."
88
88
  end
89
89
  end
90
90
 
@@ -93,11 +93,11 @@ describe Ayadn::BlacklistWorkers do
93
93
  k = Ayadn::BlacklistWorkers.new
94
94
  k.add(['client', 'IFTTT'])
95
95
  expect(Ayadn::Databases.blacklist['ifttt']).to eq :client
96
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"IFTTT\"]' to blacklist of clients."
96
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Added '[\"IFTTT\"]' to blacklist of clients."
97
97
  k = Ayadn::BlacklistWorkers.new
98
98
  k.remove(['client', 'IFTTT'])
99
99
  expect(Ayadn::Databases.blacklist['ifttt']).to eq nil
100
- expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Removed 'client:[\"IFTTT\"]' from blacklist."
100
+ #expect(File.read('spec/mock/ayadn.log')).to include "(wee) INFO -- Removed 'client:[\"IFTTT\"]' from blacklist."
101
101
  end
102
102
  end
103
103
 
@@ -71,41 +71,41 @@ describe Ayadn::Post do
71
71
  it "formats a reply" do
72
72
  new_post = "Hey guys!"
73
73
  replied_to = {1=>{:handle => "@test",:username => "test", :mentions => ["user1", "user2"]}}
74
- post.reply(new_post, replied_to).should eq "@test Hey guys! @user1 @user2"
74
+ expect(post.reply(new_post, replied_to)).to eq "@test Hey guys! @user1 @user2"
75
75
  replied_to = {1=>{:handle => "@test",:username => "test", :mentions => ["user1", "test"]}}
76
- post.reply(new_post, replied_to).should eq "@test Hey guys! @user1"
76
+ expect(post.reply(new_post, replied_to)).to eq "@test Hey guys! @user1"
77
77
  replied_to = {1=>{:handle => "@yo",:username => "test", :mentions => ["test", "lol"]}}
78
- post.reply(new_post, replied_to).should eq "@yo Hey guys! @lol"
78
+ expect(post.reply(new_post, replied_to)).to eq "@yo Hey guys! @lol"
79
79
  end
80
80
  end
81
81
 
82
82
  describe "#text_is_empty?" do
83
83
  it "checks if empty" do
84
- post.text_is_empty?(["allo"]).should be false
85
- post.text_is_empty?([""]).should be true
86
- post.text_is_empty?([]).should be true
84
+ expect(post.text_is_empty?(["allo"])).to be false
85
+ expect(post.text_is_empty?([""])).to be true
86
+ expect(post.text_is_empty?([])).to be true
87
87
  end
88
88
  end
89
89
 
90
90
  describe "#markdown_extract" do
91
91
  it "splits markdown" do
92
- post.markdown_extract("[ayadn](http://ayadn-app.net)").should eq ["ayadn", "http://ayadn-app.net"]
92
+ expect(post.markdown_extract("[ayadn](http://ayadn-app.net)")).to eq ["ayadn", "http://ayadn-app.net"]
93
93
  end
94
94
  end
95
95
 
96
96
  describe "#get_markdown_text" do
97
97
  it "extracts markdown text" do
98
- post.get_markdown_text("[ayadn](http://ayadn-app.net)").should eq "ayadn"
98
+ expect(post.get_markdown_text("[ayadn](http://ayadn-app.net)")).to eq "ayadn"
99
99
  end
100
100
  end
101
101
 
102
102
  describe "#check_post_length" do
103
103
  it "checks normal post length" do
104
- post.check_post_length(["allo", "wtf"]).should be nil #no error
104
+ expect(post.check_post_length(["allo", "wtf"])).to be nil #no error
105
105
  end
106
106
  it "checks excessive post length" do
107
107
  printed = capture_stderr do
108
- lambda {post.check_post_length(["allo", "wtf dude", "ok whatever pfff", "Black malt berliner weisse, filter. Ibu degrees plato alcohol. ipa hard cider ester infusion conditioning tank. Dry stout bottom fermenting yeast wort chiller wort chiller lager hand pump ! All-malt dunkle bright beer grainy, original gravity wheat beer glass."])}.should raise_error(SystemExit)
108
+ expect(lambda {post.check_post_length(["allo", "wtf dude", "ok whatever pfff", "Black malt berliner weisse, filter. Ibu degrees plato alcohol. ipa hard cider ester infusion conditioning tank. Dry stout bottom fermenting yeast wort chiller wort chiller lager hand pump ! All-malt dunkle bright beer grainy, original gravity wheat beer glass."])}).to raise_error(SystemExit)
109
109
  end
110
110
  expect(printed).to include 'Canceled: too long. 256 max, 32 characters to remove.'
111
111
  end
@@ -113,11 +113,11 @@ describe Ayadn::Post do
113
113
 
114
114
  describe "#check_message_length" do
115
115
  it "checks normal message length" do
116
- post.check_message_length(["allo", "wtf"]).should be nil #no error
116
+ expect(post.check_message_length(["allo", "wtf"])).to be nil #no error
117
117
  end
118
118
  it "checks excessive message length" do
119
119
  printed = capture_stderr do
120
- lambda {post.check_message_length(["Black malt berliner weisse, filter. Ibu degrees plato alcohol. ipa hard cider ester infusion conditioning tank. Dry stout bottom fermenting yeast wort chiller wort chiller lager hand pump ! All-malt dunkle bright beer grainy, original gravity wheat beer glass!!" * 8])}.should raise_error(SystemExit)
120
+ expect(lambda {post.check_message_length(["Black malt berliner weisse, filter. Ibu degrees plato alcohol. ipa hard cider ester infusion conditioning tank. Dry stout bottom fermenting yeast wort chiller wort chiller lager hand pump ! All-malt dunkle bright beer grainy, original gravity wheat beer glass!!" * 8])}).to raise_error(SystemExit)
121
121
  end
122
122
  expect(printed).to include 'Canceled: too long. 2048 max, 40 characters to remove.'
123
123
  end
@@ -112,19 +112,19 @@ describe Ayadn::SetCounts do
112
112
  end
113
113
  it "raises error if incorrect count value" do
114
114
  printed = capture_stderr do
115
- lambda {Ayadn::SetCounts.new.validate('201')}.should raise_error(SystemExit)
115
+ expect(lambda {Ayadn::SetCounts.new.validate('201')}).to raise_error(SystemExit)
116
116
  end
117
117
  expect(printed).to include 'This paramater must be an integer between 1 and 200'
118
118
  end
119
119
  it "raises error if incorrect count value" do
120
120
  printed = capture_stderr do
121
- lambda {Ayadn::SetCounts.new.validate('0')}.should raise_error(SystemExit)
121
+ expect(lambda {Ayadn::SetCounts.new.validate('0')}).to raise_error(SystemExit)
122
122
  end
123
123
  expect(printed).to include 'This paramater must be an integer between 1 and 200'
124
124
  end
125
125
  it "raises error if incorrect count value" do
126
126
  printed = capture_stderr do
127
- lambda {Ayadn::SetCounts.new.validate('yolo')}.should raise_error(SystemExit)
127
+ expect(lambda {Ayadn::SetCounts.new.validate('yolo')}).to raise_error(SystemExit)
128
128
  end
129
129
  expect(printed).to include 'This paramater must be an integer between 1 and 200'
130
130
  end
@@ -165,7 +165,7 @@ describe Ayadn::SetBackup do
165
165
  end
166
166
  it "raises error if incorrect boolean" do
167
167
  printed = capture_stderr do
168
- lambda {Ayadn::SetBackup.new.validate('yolo')}.should raise_error(SystemExit)
168
+ expect(lambda {Ayadn::SetBackup.new.validate('yolo')}).to raise_error(SystemExit)
169
169
  end
170
170
  expect(printed).to include "You have to submit valid items. See 'ayadn -sg' for a list of valid parameters and values"
171
171
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ayadn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dejonckheere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -293,7 +293,7 @@ rubyforge_project:
293
293
  rubygems_version: 2.3.0
294
294
  signing_key:
295
295
  specification_version: 4
296
- summary: App.net command-line client.
296
+ summary: App.net command-line client. See http://ayadn-app.net/doc/
297
297
  test_files:
298
298
  - spec/helpers.rb
299
299
  - spec/mock/@ericd.json