label 0.2.0 → 1.0.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: 69b062d913786723a28cb0fcf27ba5e2a614a4ea
4
- data.tar.gz: 5c4e954723b928ac583a463bc956b05c28d7ea88
3
+ metadata.gz: 3cb8dd7f6e176205dd916805f27fc9576243c502
4
+ data.tar.gz: 81cf12e1c110932e1af612d7c770129bd45e544d
5
5
  SHA512:
6
- metadata.gz: 05fb43e1d46f8bb542eea2059efc4f3a3cadbeaee5c5a989bfd2c170048758b5816bd661540359dd17c711c3f6d0a3118843d6e6e975d8934f9cc47318b905b8
7
- data.tar.gz: 798b20fc30a6211c587c8b13a824952686259ce6c8f0881a6fbc1df678958c56c1722647f344bb11f4d82cf8de0458b163dded6e36b45e7b40ce4129d877f44c
6
+ metadata.gz: b97d902c5b9e68e4aefec5fecf62e3ab56b1d525353c9523bd05865d97454a5d1b35cd5bca784e0357f1e30e85897ac7fcb2e2ad6e960224a30d5c30ec2eb668
7
+ data.tar.gz: 788f03140ac59c48825f264df0ccf9b1da4eb50d045c94ccfb5bca3b61f85a4e381a0a6346b67c3a81495ebf31aeb771f80ac412fbd7b6f9a55872d38613f981
@@ -1,7 +1,7 @@
1
1
  module Label
2
2
  class DescriptionFormatter
3
3
 
4
- FIRST_SENTENCE_REGEXP = /(?<first_sentence>([^.]*https?:\/\/[^\s]*\..*\..*)|([^.]*\.))(?<rest>.*)/
4
+ FIRST_SENTENCE_REGEXP = /(?<first_sentence>.+?(\.\s|\Z))/m
5
5
  CHARACTERS_PER_LINE = 90
6
6
 
7
7
  # Formats a description
@@ -1,3 +1,3 @@
1
1
  module Label
2
- VERSION = "0.2.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -14,6 +14,11 @@ describe Label::DescriptionFormatter do
14
14
  expect(format(description)).to eq "# #{description}"
15
15
  end
16
16
 
17
+ it 'ignores dots that do not end a sentence' do
18
+ description = "Ruby 2.0 is awesome"
19
+ expect(format(description)).to eq "# #{description}"
20
+ end
21
+
17
22
  context 'with long descriptions' do
18
23
  it 'returns the first sentence (ended by ".") for long descriptions' do
19
24
  long_description = "Nokogiri (é\u008B¸) is an HTML, XML, SAX, and Reader "+
@@ -43,7 +48,7 @@ describe Label::DescriptionFormatter do
43
48
  it 'returns the first sentence in multiple lines when this is too long' do
44
49
  long_description = "\\Unicorn is an HTTP server for Rack applications "+
45
50
  "designed to only serve\nfast clients on low-latency, high-bandwidth "+
46
- "connections and take\nadvantage of features in Unix/Unix-like kernels."+
51
+ "connections and take\nadvantage of features in Unix/Unix-like kernels. "+
47
52
  "Slow clients should\nonly be served by placing a reverse proxy capable"+
48
53
  " of fully buffering\nboth the the request and response in between "+
49
54
  "\\Unicorn and slow clients."
@@ -41,7 +41,7 @@ describe Label do
41
41
  allow(subject).to receive(:describe).with("unicorn", nil).and_return(
42
42
  "\\Unicorn is an HTTP server for Rack applications "+
43
43
  "designed to only serve\nfast clients on low-latency, high-bandwidth "+
44
- "connections and take\nadvantage of features in Unix/Unix-like kernels."+
44
+ "connections and take\nadvantage of features in Unix/Unix-like kernels. "+
45
45
  "Slow clients should\nonly be served by placing a reverse proxy capable"+
46
46
  " of fully buffering\nboth the the request and response in between "+
47
47
  "\\Unicorn and slow clients."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: label
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2014-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler