Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Numerous always-ignore extensions
###################
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~

*.sass-cache
# Folders to ignore
###################
.hg
.svn
.CVS
# OS or Editor folders
###################
.DS_Store
Icon?
Thumbs.db
ehthumbs.db
nbproject
.cache
.project
.settings
.tmproj
*.esproj
*.sublime-project
*.sublime-workspace
# Dreamweaver added files
###################
_notes
dwsync.xml
# Komodo
###################
*.komodoproject
.komodotools
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ growl.notify({
# -- Instant notification
GNTP.notify({
:app_name => "Instant notify",
:title => "Instant notification",
:title => "Instant notification",
:text => "Instant notification available now.",
:icon => "http://www.hatena.ne.jp/users/sn/snaka72/profile.gif",
})
Expand Down
6 changes: 3 additions & 3 deletions example/NOTE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Attention when twitter_notifier.rb is used
Following gem is necessary to operate this script.
Following gem is necessary to operate this script.
- json_pure
- pit

Please ensure that an appropriate value to environment variable EDITOR is set if you start and use Pit.
Pit starts executing the editor command set to EDITOR for the edit of account information, and the script will not operate correctly when this variable is not appropriately set.
Please ensure that an appropriate value to environment variable EDITOR is set if you start and use Pit.
Pit starts executing the editor command set to EDITOR for the edit of account information, and the script will not operate correctly when this variable is not appropriately set.

26 changes: 13 additions & 13 deletions test/ruby_gntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"Notification-Name: #{NOTIFICATION_NAME}\r\n",
"Notification-Display-Name: #{NOTIFICATION_NAME}\r\n",
"Notification-Enabled: True\r\n"
].each {|expected_text|
@sended_messages.last.should include(expected_text)
].each {|expected_text|
@sended_messages.last.should include(expected_text)
}

end
Expand Down Expand Up @@ -84,8 +84,8 @@
"Notification-Name: #{NOTIFICATION_NAME}\r\n",
"Notification-Display-Name: #{NOTIFICATION_NAME}\r\n",
"Notification-Enabled: True\r\n"
].each {|expected_text|
@sended_messages.last.should include(expected_text)
].each {|expected_text|
@sended_messages.last.should include(expected_text)
}

end
Expand All @@ -100,8 +100,8 @@
"Application-Name: #{DEFAULT_APP_NAME}\r\n",
"Notification-Name: #{NOTIFICATION_NAME}\r\n",
"Notification-Title: \r\n"
].each {|expected_text|
@sended_messages.last.should include(expected_text)
].each {|expected_text|
@sended_messages.last.should include(expected_text)
}
end

Expand Down Expand Up @@ -129,8 +129,8 @@
[
"Notification-Callback-Context: (none)\r\n",
"Notification-Callback-Context-Type: (none)\r\n"
].each {|expected_text|
@sended_messages.last.should include(expected_text)
].each {|expected_text|
@sended_messages.last.should include(expected_text)
}

# wait for callback called
Expand All @@ -149,23 +149,23 @@
[
"Notification-Callback-Context: (none)\r\n",
"Notification-Callback-Context-Type: (none)\r\n"
].each {|expected_text|
@sended_messages.last.should_not include(expected_text)
].each {|expected_text|
@sended_messages.last.should_not include(expected_text)
}
end

it "should send 'Notification-Callback-*' header when block parameter has not given, but supply :callback_* parameter given" do
@gntp = GNTP.new
@gntp.register :notifications => [{:name => NOTIFICATION_NAME}]
@gntp.notify :name => NOTIFICATION_NAME,
@gntp.notify :name => NOTIFICATION_NAME,
:callback_context => 'hoge',
:callback_context_type => 'text'

[
"Notification-Callback-Context: hoge\r\n",
"Notification-Callback-Context-Type: text\r\n"
].each {|expected_text|
@sended_messages.last.should include(expected_text)
].each {|expected_text|
@sended_messages.last.should include(expected_text)
}
end

Expand Down
2 changes: 1 addition & 1 deletion test/ruby_gntp_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def create_stub_socket(ok_response, sended_messages)
ok_response.seek(0, IO::SEEK_END)
ok_response.write msg
ok_response.rewind
end
end

stub(sock).gets do
ok_response.gets
Expand Down