yapt 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yapt.rb +1 -0
- data/lib/yapt/comment.rb +32 -0
- data/lib/yapt/member.rb +5 -1
- data/lib/yapt/request.rb +1 -0
- data/lib/yapt/story.rb +4 -0
- data/lib/yapt/templates/detail.erb +4 -5
- data/lib/yapt/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 999aeedf176d0b43f77dcc9a399d83201d9775e2
|
4
|
+
data.tar.gz: 896a433f93e1c8635ca5921757f642872f5e0939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7883e0d93da702b62ae4042d1ecea6c8d3c8236e48b0b2128c7f9c3226e2bc7413d8195842f0941effd0e69e19e949f34365bce2821491e792dfe1b561bcc655
|
7
|
+
data.tar.gz: a3519a4e0291b310c7c8b1aea95b595199d0205880fd9bf0f33bf4acd303135d6715ae89b6d3a7471af93a2ce5d986d341ba5a6e00f725559b21ff65912c7ddd
|
data/lib/yapt.rb
CHANGED
data/lib/yapt/comment.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Yapt
|
2
|
+
class Comment
|
3
|
+
def self.find(story_id)
|
4
|
+
results = Request.new("stories/#{story_id}/comments", {}, :get).result
|
5
|
+
results.collect {|r| new(r) }
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_reader :raw
|
9
|
+
def initialize(data)
|
10
|
+
@raw = data
|
11
|
+
end
|
12
|
+
|
13
|
+
[:person_id, :created_at, :updated_at, :text,
|
14
|
+
:story_id, :id].each do |attr|
|
15
|
+
define_method attr do
|
16
|
+
raw[attr.to_s]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def commenter
|
21
|
+
@commenter ||= Member.find(person_id)
|
22
|
+
end
|
23
|
+
|
24
|
+
def created_at_display
|
25
|
+
time_display(created_at)
|
26
|
+
end
|
27
|
+
|
28
|
+
def time_display(time)
|
29
|
+
Time.parse(time).strftime("%a %d %b %I:%M")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/yapt/member.rb
CHANGED
@@ -3,7 +3,11 @@ require "yaml"
|
|
3
3
|
module Yapt
|
4
4
|
class Member
|
5
5
|
def self.find(id)
|
6
|
-
new all.detect {|u| u["person"]["id"] == id }
|
6
|
+
new (all.detect {|u| u["person"]["id"] == id } || inactive_user)
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.inactive_user
|
10
|
+
{ "person" => { "initials" => '???' } }
|
7
11
|
end
|
8
12
|
|
9
13
|
attr_reader :membership
|
data/lib/yapt/request.rb
CHANGED
data/lib/yapt/story.rb
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
<%= story.id %> | <%= story.name %>
|
3
3
|
<%= story.description %>
|
4
4
|
<%= '-' * 100 %>
|
5
|
+
<% story.comments.each_with_index do |comment, i| -%>
|
6
|
+
<%= i+1 %>. <%= comment.commenter.initials %>: <%= comment.text %>
|
7
|
+
<% end %>
|
8
|
+
<%= '-' * 100 %>
|
5
9
|
<%= story.created_at_display %> | <%= story.updated_at_display %> | <%= story.current_state %> | <%= story.requester_initials %> | <%= story.owner_initials %>
|
6
10
|
<%= '=' * 100 %>
|
7
11
|
<% end %>
|
8
|
-
<% if false %>
|
9
|
-
[:url, :story_type, :description, :id,
|
10
|
-
:current_state, :labels, :owned_by_id, :created_at, :kind,
|
11
|
-
:project_id, :requested_by_id, :updated_at, :name].each do |attr|
|
12
|
-
<% end %>
|
data/lib/yapt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yapt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Schenkman-Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: boson
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- Rakefile
|
110
110
|
- bin/yapt
|
111
111
|
- lib/yapt.rb
|
112
|
+
- lib/yapt/comment.rb
|
112
113
|
- lib/yapt/config.rb
|
113
114
|
- lib/yapt/filter.rb
|
114
115
|
- lib/yapt/member.rb
|