replacer_bot 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19abcdfabf6c0bf9b60737242db4f0b2b81cfd8a
4
- data.tar.gz: 71c81bee80f3775d423de810c51f2473c9ae3139
3
+ metadata.gz: c33867a4e5550dc350a9e29c2e9b9e3bf2c6dd44
4
+ data.tar.gz: b3b044806189b56387cd0a81a6a4eb2f11277e17
5
5
  SHA512:
6
- metadata.gz: fbe3eb39215c8e41c236cc10132af163def7147cdaaf20854244f258e0d2dcdef2e08fdda0cde87968c2069d57917c8abfc20c48ae90442853055287065e5eac
7
- data.tar.gz: 278f691140d7b6824153d6da70daa72d901358b0fe533e92c20f3cd177b9b4e6e33f1d27ad300903b731f666e3fdb2af79a042eba072b5eed737e33d8ea18d11
6
+ metadata.gz: ae67de7b17728c96e6bd9788e5aac35ea7571505ee3dc1f90f4eb243f0f114710ffa3cf30b681fa56aaf61c75224907069122a2edb40b4375abf591f37cae518
7
+ data.tar.gz: 355b2801819ee449c21fdbbbedb5caa7bd5e04055c085836a8d3c44c2889047e06f5851b6c67ed8787493cc1a271ee20615f006f27ad78357233e6f0e2e31518
@@ -49,6 +49,13 @@ module ReplacerBot
49
49
  string.gsub(/\n+/, ' ').gsub(/ +/, ' ').strip
50
50
  end
51
51
 
52
+ def self.title_case string
53
+ bits = string.split ''
54
+ bits[0] = bits[0].upcase
55
+
56
+ bits.join ''
57
+ end
58
+
52
59
  def self.truncate text
53
60
  return_text = ''
54
61
  text.split.each do |word|
@@ -15,7 +15,7 @@ module ReplacerBot
15
15
  end
16
16
 
17
17
  def tweets
18
- search.map { |r| ReplacerBot.truncate ReplacerBot.encode_entities ReplacerBot.replace string: r.text }
18
+ search.map { |r| ReplacerBot.truncate ReplacerBot.title_case ReplacerBot.encode_entities ReplacerBot.replace string: r.text }
19
19
  end
20
20
 
21
21
  def tweet dry_run: false, chatty: false
@@ -1,3 +1,3 @@
1
1
  module ReplacerBot
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -70,6 +70,10 @@ module ReplacerBot
70
70
  expect(ReplacerBot.despace " open\n\ndata ").to eq 'open data'
71
71
  end
72
72
 
73
+ it 'upcases the first character' do
74
+ expect(ReplacerBot.title_case 'lowercase at the start').to eq 'Lowercase at the start'
75
+ end
76
+
73
77
  it 'trims to 140 characters nicely' do
74
78
  expect(ReplacerBot.truncate 'FYI via @DBMph: The 2016 proposed budget is now in Taylor Swift format! You may access it on our website: http://t.co/EO6Lep3PeW #Transparency').
75
79
  to eq 'FYI via @DBMph: The 2016 proposed budget is now in Taylor Swift format! You may access it on our website: http://t.co/EO6Lep3PeW'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: replacer_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - pikesley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-19 00:00:00.000000000 Z
11
+ date: 2015-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter