url_store 0.3.2 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source :rubygems
2
+ gemspec
2
3
 
3
- group :dev do
4
+ group :development do
4
5
  gem 'rake'
5
6
  gem 'rspec', '~>2'
6
- gem 'jeweler'
7
7
  end
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ url_store (0.3.4)
5
+
1
6
  GEM
2
7
  remote: http://rubygems.org/
3
8
  specs:
4
9
  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
10
  rake (0.8.7)
11
11
  rspec (2.5.0)
12
12
  rspec-core (~> 2.5.0)
@@ -21,6 +21,6 @@ PLATFORMS
21
21
  ruby
22
22
 
23
23
  DEPENDENCIES
24
- jeweler
25
24
  rake
26
25
  rspec (~> 2)
26
+ url_store!
data/Rakefile CHANGED
@@ -1,19 +1,22 @@
1
+ require 'bundler/gem_tasks'
2
+
1
3
  task :default do
2
4
  sh "rspec spec/"
3
5
  end
4
6
 
5
- begin
6
- require 'jeweler'
7
- project_name = 'url_store'
8
- Jeweler::Tasks.new do |gem|
9
- gem.name = project_name
10
- gem.description = gem.summary = "Data securely stored in urls."
11
- gem.email = "grosser.michael@gmail.com"
12
- gem.homepage = "http://github.com/grosser/#{project_name}"
13
- gem.authors = ["Michael Grosser"]
14
- end
7
+ # extracted from https://github.com/grosser/project_template
8
+ rule /^version:bump:.*/ do |t|
9
+ sh "git status | grep 'nothing to commit'" # ensure we are not dirty
10
+ index = ['major', 'minor','patch'].index(t.name.split(':').last)
11
+ file = 'lib/url_store/version.rb'
12
+
13
+ version_file = File.read(file)
14
+ old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
15
+ version_parts[index] = version_parts[index].to_i + 1
16
+ version_parts[2] = 0 if index < 2 # remove patch for minor
17
+ version_parts[1] = 0 if index < 1 # remove minor for major
18
+ new_version = version_parts * '.'
19
+ File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
15
20
 
16
- Jeweler::GemcutterTasks.new
17
- rescue LoadError
18
- puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
21
+ sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
19
22
  end
@@ -1 +1,2 @@
1
- UrlStore.defaults = {:secret => '<%= ActiveSupport::SecureRandom.hex(16) %>'}
1
+ <% generator = (defined?(SecureRandom) ? SecureRandom : ActiveSupport::SecureRandom) -%>
2
+ UrlStore.defaults = {:secret => '<%= generator.hex(16) %>'}
@@ -1,5 +1,4 @@
1
1
  class UrlStore::Railtie < ::Rails::Railtie
2
-
3
2
  generators do
4
3
  require 'url_store/generators/initializer'
5
4
  end
@@ -0,0 +1,3 @@
1
+ class UrlStore
2
+ VERSION = Version = '0.3.4'
3
+ end
data/lib/url_store.rb CHANGED
@@ -1,9 +1,8 @@
1
+ require 'url_store/version'
1
2
  require 'url_store/compact_encoder'
2
-
3
3
  require 'url_store/railtie' if defined?(::Rails) && ::Rails::VERSION::MAJOR >= 3
4
4
 
5
5
  class UrlStore
6
- VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
7
6
  SECRET = 'asdkasjlwqjdqaccxnjkasdfh2313'
8
7
 
9
8
  # (convert to base64url <-> RFC4648) and '|'
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe UrlStore::CompactEncoder do
4
4
  before do
@@ -1,5 +1,6 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
- require 'cgi'
1
+ # encoding: utf-8
2
+ require "spec_helper"
3
+ require "cgi"
3
4
 
4
5
  describe UrlStore do
5
6
  before do
data/url_store.gemspec CHANGED
@@ -1,50 +1,12 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
2
+ name = "url_store"
3
+ require "#{name}/version"
5
4
 
6
- Gem::Specification.new do |s|
7
- s.name = %q{url_store}
8
- s.version = "0.3.2"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
5
+ Gem::Specification.new name, UrlStore::VERSION do |s|
6
+ s.summary = "Data securely stored in urls."
11
7
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2011-05-28}
13
- s.description = %q{Data securely stored in urls.}
14
- s.email = %q{grosser.michael@gmail.com}
15
- s.files = [
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
- "lib/url_store/generators/initializer.rb",
24
- "lib/url_store/generators/templates/initializer.erb",
25
- "lib/url_store/railtie.rb",
26
- "spec/spec_helper.rb",
27
- "spec/url_store/compact_encoder_spec.rb",
28
- "spec/url_store_spec.rb",
29
- "url_store.gemspec"
30
- ]
31
- s.homepage = %q{http://github.com/grosser/url_store}
32
- s.require_paths = ["lib"]
33
- s.rubygems_version = %q{1.6.2}
34
- s.summary = %q{Data securely stored in urls.}
35
- s.test_files = [
36
- "spec/spec_helper.rb",
37
- "spec/url_store/compact_encoder_spec.rb",
38
- "spec/url_store_spec.rb"
39
- ]
40
-
41
- if s.respond_to? :specification_version then
42
- s.specification_version = 3
43
-
44
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
- else
46
- end
47
- else
48
- end
8
+ s.email = "michael@grosser.it"
9
+ s.homepage = "http://github.com/grosser/#{name}"
10
+ s.files = `git ls-files`.split("\n")
11
+ s.license = "MIT"
49
12
  end
50
-
metadata CHANGED
@@ -1,82 +1,65 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: url_store
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.4
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 3
9
- - 2
10
- version: 0.3.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Michael Grosser
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-05-28 00:00:00 +02:00
19
- default_executable:
12
+ date: 2012-04-29 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
- description: Data securely stored in urls.
23
- email: grosser.michael@gmail.com
14
+ description:
15
+ email: michael@grosser.it
24
16
  executables: []
25
-
26
17
  extensions: []
27
-
28
18
  extra_rdoc_files: []
29
-
30
- files:
19
+ files:
31
20
  - Gemfile
32
21
  - Gemfile.lock
33
22
  - Rakefile
34
23
  - Readme.md
35
- - VERSION
36
24
  - lib/url_store.rb
37
25
  - lib/url_store/compact_encoder.rb
38
26
  - lib/url_store/generators/initializer.rb
39
27
  - lib/url_store/generators/templates/initializer.erb
40
28
  - lib/url_store/railtie.rb
29
+ - lib/url_store/version.rb
41
30
  - spec/spec_helper.rb
42
31
  - spec/url_store/compact_encoder_spec.rb
43
32
  - spec/url_store_spec.rb
44
33
  - url_store.gemspec
45
- has_rdoc: true
46
34
  homepage: http://github.com/grosser/url_store
47
- licenses: []
48
-
35
+ licenses:
36
+ - MIT
49
37
  post_install_message:
50
38
  rdoc_options: []
51
-
52
- require_paths:
39
+ require_paths:
53
40
  - lib
54
- required_ruby_version: !ruby/object:Gem::Requirement
41
+ required_ruby_version: !ruby/object:Gem::Requirement
55
42
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ segments:
61
48
  - 0
62
- version: "0"
63
- required_rubygems_version: !ruby/object:Gem::Requirement
49
+ hash: 903047678128005122
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
51
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ segments:
70
57
  - 0
71
- version: "0"
58
+ hash: 903047678128005122
72
59
  requirements: []
73
-
74
60
  rubyforge_project:
75
- rubygems_version: 1.6.2
61
+ rubygems_version: 1.8.24
76
62
  signing_key:
77
63
  specification_version: 3
78
64
  summary: Data securely stored in urls.
79
- test_files:
80
- - spec/spec_helper.rb
81
- - spec/url_store/compact_encoder_spec.rb
82
- - spec/url_store_spec.rb
65
+ test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.3.2