tw 1.2.1 → 1.3.0

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: 5196cf7e6b53a50e28a360b7e290b5e17fa01b19
4
- data.tar.gz: b4c3a26b6a1c6646c591bfd912abf7aec5b1850b
3
+ metadata.gz: 0a66002fd52aaa946fd00e7d81971e174e7cb1d8
4
+ data.tar.gz: 1ce32cec7ae098c80e0910c04759a58597d186a0
5
5
  SHA512:
6
- metadata.gz: f28a01c369e7f4058f51bc6ccd38cc5f03ba5c1ef6397bc440e592483cb6b080ffc8b90d9618f8448fec9ea54641e2bbce5d479c43966483859b5048aabe8134
7
- data.tar.gz: d122a1cac4b0ece26969967114481e3be21014496339249907dd16481536a2e2f37abb4c53390130882606890341e852e20775b7dfc4ec65f7987528877bcfcb
6
+ metadata.gz: ca8137f43aa89fd0f8fcd12766b9bff18683c7b509ca79c66cc5e717c45fe9c48ac13a6ab4233613f741bb857fedeb75e0817f610087ae7d4549359c3829801a
7
+ data.tar.gz: 2ce65bad6c7e863850f9f98a2fb90f1e5ba2e682369f13260b75cbac24bfa73c5e32a89d95cf620c82a3b8fa92b562c5e34113902646ac2b3fc6d5668849952a
@@ -1,3 +1,7 @@
1
+ === 1.3.0 2018-02-18
2
+
3
+ * 280 chars tweet (#75)
4
+
1
5
  === 1.2.1 2017-12-10
2
6
 
3
7
  * Fix deprecated warnings (#77)
@@ -4,7 +4,7 @@ require File.expand_path 'render', File.dirname(__FILE__)
4
4
  require File.expand_path 'helper', File.dirname(__FILE__)
5
5
 
6
6
  module Tw::App
7
-
7
+
8
8
  def self.new
9
9
  Main.new
10
10
  end
@@ -138,7 +138,7 @@ module Tw::App
138
138
  else
139
139
  message = @args.argv.join(' ')
140
140
  tweet_opts = {}
141
- if (len = message.char_length_with_t_co) > 140
141
+ if (len = message.char_length_with_t_co) > 280
142
142
  STDERR.puts "tweet too long (#{len} chars)"
143
143
  on_error
144
144
  else
@@ -2,7 +2,7 @@
2
2
  class String
3
3
 
4
4
  def char_length
5
- self.split(//u).size
5
+ self.split(//u).map{|i| i.bytes.length > 1 ? 2 : 1}.reduce(:+)
6
6
  end
7
7
 
8
8
  def char_length_with_t_co
@@ -1,3 +1,3 @@
1
1
  module Tw
2
- VERSION = '1.2.1'
2
+ VERSION = '1.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tw
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-09 00:00:00.000000000 Z
11
+ date: 2018-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter