bitmarkable 0.0.2.1 → 0.0.2.2

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: 95826a80024683841b5dff52af8e8eddb8ca75f5
4
- data.tar.gz: 0e27b5bfdb83fcc52072e139d1027be8d41ace4c
3
+ metadata.gz: b0bec79f9601e2054b1fd014cd9fdf1de43c2d0b
4
+ data.tar.gz: 677a4e1bf013f1c3d4c7b3ef4b4290a68f8cb82e
5
5
  SHA512:
6
- metadata.gz: d77ebedcc64ff72756f1803f139a6184968a5d86e0f4914958a502979193db9cd6fe73888653a96b5e23d234435ca7f597f6acbb32c7a5c58e2d3dfa9241487b
7
- data.tar.gz: 081b5ef097be4ee54449255df636bb4daac8c2d9583898876dfd176355c773209922f142caef530da26a49d2d1794ecd996954d7f6847498f24c9a04fe5dc252
6
+ metadata.gz: 48bc55c4eb9f963e1c8ad26cad06eaf701366a9c426b63e100c5e3e847a40016af4bbb61949730ce64547788bc5c08c30ab92c35858aa0485a3ed257f2bce05e
7
+ data.tar.gz: 1f139cddb7c2a0309fd33bae936aa40b0faf23e3d6f4ea9e38a3c619a66e925792e0e3c5822bd04147f73a204b8fac26176f89c9d0548d3204910a81f219ccf0
data/README.md CHANGED
@@ -37,6 +37,8 @@ The short URL can then be fetched using `instance.bitmark`. The value is stored
37
37
 
38
38
  If the bitmarkable class responds to `.delay` (e.g. you're using DelayedJob or Sidekiq) then bitmarks will be processed asynchronously.
39
39
 
40
+ If running in Rails and in development or test environments, the bitmark will be set to the full localhost URL and the bitly API will not be called (because it will not shorten localhost URLs). The URL will still be set asynchronously to mimic production behavior.
41
+
40
42
  ## Contributing
41
43
 
42
44
  1. Fork it
@@ -26,7 +26,11 @@ module Bitmarkable
26
26
  end
27
27
 
28
28
  def save_bitmark(object, url)
29
- object.bitmark = Bitly.shorten(url)
29
+ if defined?(Rails) && !(Rails.env.development? || Rails.env.test?)
30
+ object.bitmark = Bitly.shorten(url)
31
+ else
32
+ object.bitmark = url
33
+ end
30
34
  end
31
35
  end
32
36
 
data/lib/bitmarkable.rb CHANGED
@@ -7,5 +7,5 @@ require "bitmarkable/bitmark"
7
7
  require "bitmarkable/bitly"
8
8
 
9
9
  module Bitmarkable
10
- VERSION = "0.0.2.1"
10
+ VERSION = "0.0.2.2"
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitmarkable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.1
4
+ version: 0.0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Friedman