relevant-datetime 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ pkg
2
+ relevant*.gem
@@ -0,0 +1 @@
1
+ Datetime widget for Relevant
@@ -0,0 +1,29 @@
1
+ require 'rake'
2
+ require File.dirname(__FILE__) + "/lib/relevant/datetime.rb"
3
+
4
+ require 'rspec/core/rake_task'
5
+
6
+ begin
7
+ require 'jeweler'
8
+ Jeweler::Tasks.new do |gemspec|
9
+ gemspec.version = Relevant::Datetime::Version
10
+ gemspec.name = "relevant-datetime"
11
+ gemspec.summary = "Datetime widget for Relevant"
12
+ gemspec.description = "Check the time"
13
+ gemspec.email = "opensource@thinkrelevance.com"
14
+ gemspec.homepage = "http://github.com/relevance/relevant-datetime"
15
+ gemspec.authors = ["Jared Pace", "Rob Sanheim"]
16
+ gemspec.add_dependency "relevant-widget", "~> 0.0.6"
17
+ gemspec.add_development_dependency "rspec", "~> 2.0.0.beta.22"
18
+ end
19
+ Jeweler::GemcutterTasks.new
20
+
21
+ rescue LoadError
22
+ puts "Jeweler not available. Install it with: gem install jeweler"
23
+ end
24
+
25
+ require 'rspec/core/rake_task'
26
+ RSpec::Core::RakeTask.new(:spec)
27
+ task :default => :spec
28
+
29
+ task :full_release => [:check_dependencies, :spec, :release]
@@ -0,0 +1,28 @@
1
+ require "relevant/widget"
2
+
3
+ module Relevant
4
+ class Datetime
5
+ Version = "0.0.1"
6
+ include Relevant::Widget
7
+
8
+ available_options :format => :string
9
+
10
+ refresh_every 1.minute
11
+
12
+ template_format :haml
13
+ template %q[
14
+ %span.datetime= Time.zone.now.strftime(options[:format])
15
+ :css
16
+ span.datetime {
17
+ display: block;
18
+ text-align: center;
19
+ font-size: 4em;
20
+ line-height: 1.1em;
21
+ font-family: "Gill Sans", Helvetica, Arial;
22
+ }
23
+ ]
24
+
25
+ end
26
+ end
27
+
28
+ Relevant.register Relevant::Datetime
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe Relevant::Datetime do
4
+
5
+ it 'displays the time given a strftime format' do
6
+ widget = Relevant::Datetime.setup :format => '%m/%d/%Y'
7
+ widget.to_html.should include(Time.zone.now.strftime('%m/%d/%Y'))
8
+ end
9
+
10
+ end
@@ -0,0 +1,17 @@
1
+ require 'rspec'
2
+
3
+ $LOAD_PATH.unshift "../lib"
4
+ require "relevant/datetime"
5
+
6
+ RSpec.configure do |config|
7
+ config.color_enabled = true
8
+ config.mock_with :mocha
9
+
10
+ config.formatter = :progress
11
+ config.color_enabled = true
12
+ config.filter_run :focused => true
13
+ config.run_all_when_everything_filtered = true
14
+ config.alias_example_to :fit, :focused => true
15
+ end
16
+
17
+ Time.zone = 'UTC'
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: relevant-datetime
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Jared Pace
13
+ - Rob Sanheim
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-24 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: relevant-widget
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 0
31
+ - 0
32
+ - 6
33
+ version: 0.0.6
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ segments:
45
+ - 2
46
+ - 0
47
+ - 0
48
+ - beta
49
+ - 22
50
+ version: 2.0.0.beta.22
51
+ type: :development
52
+ version_requirements: *id002
53
+ description: Check the time
54
+ email: opensource@thinkrelevance.com
55
+ executables: []
56
+
57
+ extensions: []
58
+
59
+ extra_rdoc_files:
60
+ - README.md
61
+ files:
62
+ - .gitignore
63
+ - README.md
64
+ - Rakefile
65
+ - lib/relevant/datetime.rb
66
+ - spec/relevant/datetime_spec.rb
67
+ - spec/spec_helper.rb
68
+ has_rdoc: true
69
+ homepage: http://github.com/relevance/relevant-datetime
70
+ licenses: []
71
+
72
+ post_install_message:
73
+ rdoc_options:
74
+ - --charset=UTF-8
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ segments:
83
+ - 0
84
+ version: "0"
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ segments:
91
+ - 0
92
+ version: "0"
93
+ requirements: []
94
+
95
+ rubyforge_project:
96
+ rubygems_version: 1.3.7
97
+ signing_key:
98
+ specification_version: 3
99
+ summary: Datetime widget for Relevant
100
+ test_files:
101
+ - spec/relevant/datetime_spec.rb
102
+ - spec/spec_helper.rb