url_store 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source :rubygems
2
+
3
+ group :dev do
4
+ gem 'rake'
5
+ gem 'rspec', '~>2'
6
+ gem 'jeweler'
7
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,26 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.2)
5
+ git (1.2.5)
6
+ jeweler (1.5.2)
7
+ bundler (~> 1.0.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ rake (0.8.7)
11
+ rspec (2.5.0)
12
+ rspec-core (~> 2.5.0)
13
+ rspec-expectations (~> 2.5.0)
14
+ rspec-mocks (~> 2.5.0)
15
+ rspec-core (2.5.1)
16
+ rspec-expectations (2.5.0)
17
+ diff-lcs (~> 1.1.2)
18
+ rspec-mocks (2.5.0)
19
+
20
+ PLATFORMS
21
+ ruby
22
+
23
+ DEPENDENCIES
24
+ jeweler
25
+ rake
26
+ rspec (~> 2)
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- task :default => :spec
2
- require 'spec/rake/spectask'
3
- Spec::Rake::SpecTask.new {|t| t.spec_opts = ['--color']}
1
+ task :default do
2
+ sh "rspec spec/"
3
+ end
4
4
 
5
5
  begin
6
6
  require 'jeweler'
@@ -16,4 +16,4 @@ begin
16
16
  Jeweler::GemcutterTasks.new
17
17
  rescue LoadError
18
18
  puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
19
- end
19
+ end
@@ -5,11 +5,19 @@ Data securely stored in urls.
5
5
  - serializing through __:marshal__ :yaml
6
6
  - hashing through DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA __SHA1__ SHA224 SHA256 SHA384 SHA512
7
7
 
8
+ Great for:
9
+
10
+ - password reset links
11
+ - email unsubscribe links
12
+ - click tracking
13
+ - access control
14
+ - ...
15
+
8
16
 
9
17
  Install
10
18
  =======
11
19
  - As gem: ` sudo gem install url_store `
12
- - As Rails plugin: ` script/plugin install git://github.com/grosser/url_store.git `
20
+ - As Rails plugin: ` rails plugin install git://github.com/grosser/url_store.git `
13
21
 
14
22
  Usage
15
23
  =====
@@ -34,9 +42,11 @@ Usage
34
42
  ### Tips
35
43
  - If you need multiple UrlStores, just use ` UrlStore.new(:secret => 'sadasd', ...) `
36
44
  - As long as you stay under 2k chars there should be no problems. [max url lengths per browser/server](http://www.boutell.com/newfaq/misc/urllength.html)
45
+ - Data is not (yet) encrypted, users could read(but not change) the encoded data
46
+ - Replay attacks are possible <-> add a timestamp to check the freshness of the encoded data
37
47
 
38
48
  Author
39
49
  =======
40
- [Michael Grosser](http://pragmatig.wordpress.com)
41
- grosser.michael@gmail.com
50
+ [Michael Grosser](http://grosser.it)<br/>
51
+ michael@grosser.it<br/>
42
52
  Hereby placed under public domain, do what you want, just do not hold me accountable...
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/lib/url_store.rb CHANGED
@@ -39,8 +39,8 @@ class UrlStore
39
39
  def encoder
40
40
  options = {:secret => SECRET}.merge(@options)
41
41
  if options[:secret] == SECRET
42
- warn "WARNING: you should not use the default secret! use UrlStore.secret='something'"
42
+ warn "WARNING: You are using the default secret! Set your own with UrlStore.defaults = {:secret => 'something'}"
43
43
  end
44
44
  UrlStore::CompactEncoder.new(options)
45
45
  end
46
- end
46
+ end
@@ -22,7 +22,7 @@ describe UrlStore do
22
22
  end
23
23
 
24
24
  it "uses a lot of different chars" do
25
- UrlStore.encode(@data).split('').uniq.size.should >= 62
25
+ UrlStore.encode(@data).split('').uniq.size.should >= 61
26
26
  end
27
27
 
28
28
  it "uses url-save characters" do
@@ -62,4 +62,4 @@ describe UrlStore do
62
62
  it "has a VERSION" do
63
63
  UrlStore::VERSION.should =~ /^\d+\.\d+\.\d+$/
64
64
  end
65
- end
65
+ end
data/url_store.gemspec CHANGED
@@ -1,47 +1,44 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{url_store}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2010-01-20}
12
+ s.date = %q{2011-03-28}
13
13
  s.description = %q{Data securely stored in urls.}
14
14
  s.email = %q{grosser.michael@gmail.com}
15
- s.extra_rdoc_files = [
16
- "README.markdown"
17
- ]
18
15
  s.files = [
19
- "README.markdown",
20
- "Rakefile",
21
- "VERSION",
22
- "lib/url_store.rb",
23
- "lib/url_store/compact_encoder.rb",
24
- "spec/spec_helper.rb",
25
- "spec/url_store/compact_encoder_spec.rb",
26
- "spec/url_store_spec.rb",
27
- "url_store.gemspec"
16
+ "Gemfile",
17
+ "Gemfile.lock",
18
+ "Rakefile",
19
+ "Readme.md",
20
+ "VERSION",
21
+ "lib/url_store.rb",
22
+ "lib/url_store/compact_encoder.rb",
23
+ "spec/spec_helper.rb",
24
+ "spec/url_store/compact_encoder_spec.rb",
25
+ "spec/url_store_spec.rb",
26
+ "url_store.gemspec"
28
27
  ]
29
28
  s.homepage = %q{http://github.com/grosser/url_store}
30
- s.rdoc_options = ["--charset=UTF-8"]
31
29
  s.require_paths = ["lib"]
32
- s.rubygems_version = %q{1.3.5}
30
+ s.rubygems_version = %q{1.4.2}
33
31
  s.summary = %q{Data securely stored in urls.}
34
32
  s.test_files = [
35
33
  "spec/spec_helper.rb",
36
- "spec/url_store_spec.rb",
37
- "spec/url_store/compact_encoder_spec.rb"
34
+ "spec/url_store/compact_encoder_spec.rb",
35
+ "spec/url_store_spec.rb"
38
36
  ]
39
37
 
40
38
  if s.respond_to? :specification_version then
41
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
42
39
  s.specification_version = 3
43
40
 
44
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
41
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
42
  else
46
43
  end
47
44
  else
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ hash: 17
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 1
10
+ version: 0.3.1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Michael Grosser
@@ -9,7 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-01-20 00:00:00 +01:00
18
+ date: 2011-03-28 00:00:00 +02:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
@@ -19,11 +25,13 @@ executables: []
19
25
 
20
26
  extensions: []
21
27
 
22
- extra_rdoc_files:
23
- - README.markdown
28
+ extra_rdoc_files: []
29
+
24
30
  files:
25
- - README.markdown
31
+ - Gemfile
32
+ - Gemfile.lock
26
33
  - Rakefile
34
+ - Readme.md
27
35
  - VERSION
28
36
  - lib/url_store.rb
29
37
  - lib/url_store/compact_encoder.rb
@@ -36,30 +44,36 @@ homepage: http://github.com/grosser/url_store
36
44
  licenses: []
37
45
 
38
46
  post_install_message:
39
- rdoc_options:
40
- - --charset=UTF-8
47
+ rdoc_options: []
48
+
41
49
  require_paths:
42
50
  - lib
43
51
  required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
44
53
  requirements:
45
54
  - - ">="
46
55
  - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
47
59
  version: "0"
48
- version:
49
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
50
62
  requirements:
51
63
  - - ">="
52
64
  - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
53
68
  version: "0"
54
- version:
55
69
  requirements: []
56
70
 
57
71
  rubyforge_project:
58
- rubygems_version: 1.3.5
72
+ rubygems_version: 1.4.2
59
73
  signing_key:
60
74
  specification_version: 3
61
75
  summary: Data securely stored in urls.
62
76
  test_files:
63
77
  - spec/spec_helper.rb
64
- - spec/url_store_spec.rb
65
78
  - spec/url_store/compact_encoder_spec.rb
79
+ - spec/url_store_spec.rb