tdiary 3.2.2.20130508 → 3.2.2.20130518
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +9 -4
- data/Gemfile.lock +15 -32
- data/README.md +2 -2
- data/config.ru +3 -1
- data/doc/HOWTO-testing-tDiary.md +1 -1
- data/doc/INSTALL-paas.md +1 -1
- data/doc/README.en.md +1 -1
- data/doc/README.md +1 -1
- data/js/comment_emoji_autocomplete.js +139 -0
- data/misc/migrate.rb +0 -1
- data/misc/paas/cloudfoundry/Gemfile +4 -1
- data/misc/paas/cloudfoundry/Gemfile.lock +13 -0
- data/misc/paas/cloudfoundry/tdiary.conf +3 -3
- data/misc/plugin/comment_emoji_autocomplete.rb +27 -0
- data/misc/plugin/xmlrpc/xmlrpc.rb +0 -1
- data/misc/style/gfm/gfm_style.rb +0 -2
- data/plugin/50sp.rb +3 -0
- data/tdiary/admin.rb +2 -2
- data/tdiary/base.rb +2 -4
- data/tdiary/cli.rb +30 -8
- data/tdiary/compatible.rb +41 -36
- data/tdiary/config.rb +9 -41
- data/tdiary/lang/ja.rb +5 -22
- data/tdiary/referer_manager.rb +2 -2
- data/tdiary/version.rb +1 -1
- data/tdiary/view.rb +1 -1
- data/tdiary.gemspec +2 -0
- data/tdiary.rb +1 -5
- metadata +6 -9
- data/Capfile +0 -2
- data/public/images/.gitkeep +0 -0
- data/public/javascripts/.gitkeep +0 -0
- data/public/stylesheets/.gitkeep +0 -0
- data/tdiary/deploy.rb +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02271eb97d061a659a842ab6325f5e78dd1e98cb
|
4
|
+
data.tar.gz: 170da4dde4d8c44873f97e7908d77a29069bc7b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a2c9008a97e1a7abd4e0bce476abc127752143131d5049c12ff9bd281e144caa5534f653a382d96ad44e39cc5dff67ec68a00d899a58f5208aafb61853510a7
|
7
|
+
data.tar.gz: 81135666766c82946bb6daaaaa3bf869c4878d7e925dc303e58d5d8b12851e9ba7f768b9bf1bfef4b8d2677f41a29b8982d4859f262661b60f301dd4887bc732
|
data/Gemfile
CHANGED
@@ -6,13 +6,21 @@ if File.exist?('tdiary.gemspec')
|
|
6
6
|
else
|
7
7
|
# installed by gem
|
8
8
|
gem 'tdiary'
|
9
|
+
|
10
|
+
# use edge tDiary
|
11
|
+
# gem 'tdiary', :git => 'git@github.com:tdiary/tdiary-core.git'
|
9
12
|
end
|
10
13
|
|
14
|
+
# if you use tdiary-contrib gem, uncomment this line.
|
15
|
+
gem 'tdiary-contrib'
|
16
|
+
# use edge tDiary contrib
|
17
|
+
# gem 'tdiary-contrib', :git => 'git@github.com:tdiary/tdiary-contrib.git'
|
18
|
+
|
11
19
|
gem 'rake'
|
12
20
|
|
13
21
|
gem 'rack'
|
14
22
|
gem 'sprockets'
|
15
|
-
gem 'coffee-script'
|
23
|
+
gem 'coffee-script', :group => [:development, :test]
|
16
24
|
|
17
25
|
gem 'omniauth'
|
18
26
|
gem 'omniauth-twitter'
|
@@ -38,9 +46,6 @@ platforms :jruby do
|
|
38
46
|
end
|
39
47
|
|
40
48
|
group :development do
|
41
|
-
gem 'capistrano', :require => false
|
42
|
-
gem 'capistrano_colors', :require => false
|
43
|
-
gem 'rvm-capistrano', :require => false
|
44
49
|
gem 'pit', :require => false
|
45
50
|
gem 'racksh', :require => false
|
46
51
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tdiary (3.2.2.
|
4
|
+
tdiary (3.2.2.20130518)
|
5
5
|
bundler (~> 1.3)
|
6
6
|
thor (~> 0.18)
|
7
7
|
|
@@ -9,13 +9,6 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
addressable (2.3.4)
|
12
|
-
capistrano (2.14.2)
|
13
|
-
highline
|
14
|
-
net-scp (>= 1.0.0)
|
15
|
-
net-sftp (>= 2.0.0)
|
16
|
-
net-ssh (>= 2.0.14)
|
17
|
-
net-ssh-gateway (>= 1.1.0)
|
18
|
-
capistrano_colors (0.5.5)
|
19
12
|
capybara (2.1.0)
|
20
13
|
mime-types (>= 1.16)
|
21
14
|
nokogiri (>= 1.3.3)
|
@@ -30,23 +23,22 @@ GEM
|
|
30
23
|
execjs
|
31
24
|
coffee-script-source (1.6.2)
|
32
25
|
colorize (0.5.8)
|
33
|
-
coveralls (0.6.
|
26
|
+
coveralls (0.6.7)
|
34
27
|
colorize
|
35
28
|
multi_json (~> 1.3)
|
36
29
|
rest-client
|
37
30
|
simplecov (>= 0.7)
|
38
31
|
thor
|
39
32
|
daemons (1.1.9)
|
40
|
-
dalli (2.6.
|
33
|
+
dalli (2.6.3)
|
41
34
|
diff-lcs (1.2.4)
|
42
35
|
eventmachine (1.0.3)
|
43
36
|
execjs (1.4.0)
|
44
37
|
multi_json (~> 1.0)
|
45
38
|
faraday (0.8.7)
|
46
39
|
multipart-post (~> 1.1)
|
47
|
-
ffi (1.
|
48
|
-
hashie (2.0.
|
49
|
-
highline (1.6.18)
|
40
|
+
ffi (1.8.1)
|
41
|
+
hashie (2.0.5)
|
50
42
|
hike (1.2.2)
|
51
43
|
httpauth (0.2.0)
|
52
44
|
jasmine (1.3.2)
|
@@ -60,16 +52,9 @@ GEM
|
|
60
52
|
launchy (2.3.0)
|
61
53
|
addressable (~> 2.3)
|
62
54
|
method_source (0.8.1)
|
63
|
-
mime-types (1.
|
64
|
-
multi_json (1.7.
|
55
|
+
mime-types (1.23)
|
56
|
+
multi_json (1.7.3)
|
65
57
|
multipart-post (1.2.0)
|
66
|
-
net-scp (1.1.0)
|
67
|
-
net-ssh (>= 2.6.5)
|
68
|
-
net-sftp (2.1.1)
|
69
|
-
net-ssh (>= 2.6.5)
|
70
|
-
net-ssh (2.6.7)
|
71
|
-
net-ssh-gateway (1.2.0)
|
72
|
-
net-ssh (>= 2.6.5)
|
73
58
|
nokogiri (1.5.9)
|
74
59
|
oauth (0.4.7)
|
75
60
|
oauth2 (0.8.1)
|
@@ -95,7 +80,7 @@ GEM
|
|
95
80
|
omniauth-oauth (~> 1.0)
|
96
81
|
pit (0.0.7)
|
97
82
|
posix-spawn (0.3.6)
|
98
|
-
pry (0.9.12)
|
83
|
+
pry (0.9.12.2)
|
99
84
|
coderay (~> 1.0.5)
|
100
85
|
method_source (~> 0.8)
|
101
86
|
slop (~> 3.4)
|
@@ -110,8 +95,8 @@ GEM
|
|
110
95
|
rack-test (>= 0.5)
|
111
96
|
rake (10.0.4)
|
112
97
|
redcarpet (2.2.2)
|
113
|
-
redis (3.0.
|
114
|
-
redis-namespace (1.
|
98
|
+
redis (3.0.4)
|
99
|
+
redis-namespace (1.3.0)
|
115
100
|
redis (~> 3.0.0)
|
116
101
|
rest-client (1.6.7)
|
117
102
|
mime-types (>= 1.16)
|
@@ -124,14 +109,12 @@ GEM
|
|
124
109
|
diff-lcs (>= 1.1.3, < 2.0)
|
125
110
|
rspec-mocks (2.13.1)
|
126
111
|
rubyzip (0.9.9)
|
127
|
-
rvm-capistrano (1.3.0)
|
128
|
-
capistrano (>= 2.0.0)
|
129
112
|
selenium-webdriver (2.32.1)
|
130
113
|
childprocess (>= 0.2.5)
|
131
114
|
multi_json (~> 1.0)
|
132
115
|
rubyzip
|
133
116
|
websocket (~> 1.0.4)
|
134
|
-
sequel (3.
|
117
|
+
sequel (3.47.0)
|
135
118
|
simplecov (0.7.1)
|
136
119
|
multi_json (~> 1.0)
|
137
120
|
simplecov-html (~> 0.7.1)
|
@@ -145,13 +128,15 @@ GEM
|
|
145
128
|
sqlite3 (1.3.7)
|
146
129
|
tapp (1.4.0)
|
147
130
|
thor
|
131
|
+
tdiary-contrib (3.2.2.20130511)
|
132
|
+
tdiary (>= 3.2.2.20130511)
|
148
133
|
test-unit (2.5.4)
|
149
134
|
thin (1.5.1)
|
150
135
|
daemons (>= 1.0.9)
|
151
136
|
eventmachine (>= 0.12.6)
|
152
137
|
rack (>= 1.0.0)
|
153
138
|
thor (0.18.1)
|
154
|
-
tilt (1.
|
139
|
+
tilt (1.4.1)
|
155
140
|
twitter-text (1.6.1)
|
156
141
|
unf (~> 0.0.5)
|
157
142
|
unf (0.0.5)
|
@@ -166,8 +151,6 @@ PLATFORMS
|
|
166
151
|
ruby
|
167
152
|
|
168
153
|
DEPENDENCIES
|
169
|
-
capistrano
|
170
|
-
capistrano_colors
|
171
154
|
capybara
|
172
155
|
coffee-script
|
173
156
|
coveralls
|
@@ -187,7 +170,6 @@ DEPENDENCIES
|
|
187
170
|
redis
|
188
171
|
redis-namespace
|
189
172
|
rspec
|
190
|
-
rvm-capistrano
|
191
173
|
selenium-webdriver
|
192
174
|
sequel
|
193
175
|
simplecov
|
@@ -195,6 +177,7 @@ DEPENDENCIES
|
|
195
177
|
sqlite3
|
196
178
|
tapp
|
197
179
|
tdiary!
|
180
|
+
tdiary-contrib
|
198
181
|
test-unit
|
199
182
|
thin
|
200
183
|
trinidad
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ tDiaryには以下のような特徴があります。
|
|
18
18
|
|
19
19
|
### レンタルサーバーユーザにやさしい
|
20
20
|
|
21
|
-
必要なのはRuby(1.
|
21
|
+
必要なのはRuby(1.9.2ないしは2.0.0以降に対応)だけ。単独でCGIとして動作し、基本機能はデータベースや追加のライブラリを必要としません。
|
22
22
|
|
23
23
|
### プラグインで拡張できます
|
24
24
|
|
@@ -30,4 +30,4 @@ tDiaryには以下のような特徴があります。
|
|
30
30
|
|
31
31
|
### その他
|
32
32
|
|
33
|
-
インストールにはドキュメント(doc/INSTALL.html)を参照して下さい。動作にはruby(1.
|
33
|
+
インストールにはドキュメント(doc/INSTALL.html)を参照して下さい。動作にはruby(1.9.2以降または2.0.0以降)と、CGIをサポートするWebサーバが必要です。
|
data/config.ru
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
$:.unshift( File::dirname( __FILE__ ).untaint )
|
2
2
|
require 'tdiary/environment'
|
3
|
-
require 'tdiary'
|
4
3
|
require 'tdiary/rack/html_anchor'
|
5
4
|
require 'tdiary/rack/valid_request_path'
|
6
5
|
require 'tdiary/rack/auth/basic'
|
@@ -38,6 +37,9 @@ map "#{base_dir}/assets" do
|
|
38
37
|
environment = Sprockets::Environment.new
|
39
38
|
%w(js theme).each {|path| environment.append_path File.join(TDiary.root, path) }
|
40
39
|
|
40
|
+
# FIXME: dirty hack, it should create TDiary::Server::Config.assets_path
|
41
|
+
TDiary::Contrib::Assets.setup(environment) if defined?(TDiary::Contrib)
|
42
|
+
|
41
43
|
# if you need to auto compilation for CoffeeScript
|
42
44
|
# require 'tdiary/rack/assets/precompile'
|
43
45
|
# use TDiary::Rack::Assets::Precompile, environment
|
data/doc/HOWTO-testing-tDiary.md
CHANGED
data/doc/INSTALL-paas.md
CHANGED
data/doc/README.en.md
CHANGED
data/doc/README.md
CHANGED
@@ -0,0 +1,139 @@
|
|
1
|
+
/*
|
2
|
+
* emoji_autocomplete.js : Support the automatic input of the emoji,
|
3
|
+
* using jQuery UI autocomplete.
|
4
|
+
*
|
5
|
+
* Copyright (C) 2013 by tamoot <tamoot+tdiary@gmail.com>
|
6
|
+
* You can distribute it under GPL.
|
7
|
+
*/
|
8
|
+
|
9
|
+
$(function() {
|
10
|
+
var config = new Object();
|
11
|
+
config.candidates = [":blush:",":scream:",":smirk:",":smiley:",":stuck_out_tongue_closed_eyes:",":stuck_out_tongue_winking_eye:",":rage:",":disappointed:",":sob:",":kissing_heart:",":wink:",":pensive:",":confounded:",":flushed:",":relaxed:",":mask:",":heart:",":broken_heart:",":sunny:",":umbrella:",":cloud:",":snowflake:",":snowman:",":zap:",":cyclone:",":foggy:",":ocean:",":cat:",":dog:",":mouse:",":hamster:",":rabbit:",":wolf:",":frog:",":tiger:",":koala:",":bear:",":pig:",":pig_nose:",":cow:",":boar:",":monkey_face:",":monkey:",":horse:",":racehorse:",":camel:",":sheep:",":elephant:",":panda_face:",":snake:",":bird:",":baby_chick:",":hatched_chick:",":hatching_chick:",":chicken:",":penguin:",":turtle:",":bug:",":honeybee:",":ant:",":beetle:",":snail:",":octopus:",":tropical_fish:",":fish:",":whale:",":whale2:",":dolphin:",":cow2:",":ram:",":rat:",":water_buffalo:",":tiger2:",":rabbit2:",":dragon:",":goat:",":rooster:",":dog2:",":pig2:",":mouse2:",":ox:",":dragon_face:",":blowfish:",":crocodile:",":dromedary_camel:",":leopard:",":cat2:",":poodle:",":paw_prints:",":bouquet:",":cherry_blossom:",":tulip:",":four_leaf_clover:",":rose:",":sunflower:",":hibiscus:",":maple_leaf:",":leaves:",":fallen_leaf:",":herb:",":mushroom:",":cactus:",":palm_tree:",":evergreen_tree:",":deciduous_tree:",":chestnut:",":seedling:",":blossom:",":ear_of_rice:",":shell:",":globe_with_meridians:",":sun_with_face:",":full_moon_with_face:",":new_moon_with_face:",":new_moon:",":waxing_crescent_moon:",":first_quarter_moon:",":waxing_gibbous_moon:",":full_moon:",":waning_gibbous_moon:",":last_quarter_moon:",":waning_crescent_moon:",":last_quarter_moon_with_face:",":first_quarter_moon_with_face:",":moon:",":earth_africa:",":earth_americas:",":earth_asia:",":volcano:",":milky_way:",":partly_sunny:",":octocat:",":squirrel:",":bamboo:",":gift_heart:",":dolls:",":school_satchel:",":mortar_board:",":flags:",":fireworks:",":sparkler:",":wind_chime:",":rice_scene:",":jack_o_lantern:",":ghost:",":santa:",":christmas_tree:",":gift:",":bell:",":no_bell:",":tanabata_tree:",":tada:",":confetti_ball:",":balloon:",":crystal_ball:",":cd:",":dvd:",":floppy_disk:",":camera:",":video_camera:",":movie_camera:",":computer:",":tv:",":iphone:",":phone:",":telephone:",":telephone_receiver:",":pager:",":fax:",":minidisc:",":vhs:",":sound:",":speaker:",":mute:",":loudspeaker:",":mega:",":hourglass:",":hourglass_flowing_sand:",":alarm_clock:",":watch:",":radio:",":satellite:",":loop:",":mag:",":mag_right:",":unlock:",":lock:",":lock_with_ink_pen:",":closed_lock_with_key:",":key:",":bulb:",":flashlight:",":high_brightness:",":low_brightness:",":electric_plug:",":battery:",":calling:",":email:",":mailbox:",":postbox:",":bath:",":bathtub:",":shower:",":toilet:",":wrench:",":nut_and_bolt:",":hammer:",":seat:",":moneybag:",":yen:",":dollar:",":pound:",":euro:",":credit_card:",":money_with_wings:",":e-mail:",":inbox_tray:",":outbox_tray:",":envelope:",":incoming_envelope:",":postal_horn:",":mailbox_closed:",":mailbox_with_mail:",":mailbox_with_no_mail:",":door:",":smoking:",":bomb:",":gun:",":hocho:",":pill:",":syringe:",":page_facing_up:",":page_with_curl:",":bookmark_tabs:",":bar_chart:",":chart_with_upwards_trend:",":chart_with_downwards_trend:",":scroll:",":clipboard:",":calendar:",":date:",":card_index:",":file_folder:",":open_file_folder:",":scissors:",":pushpin:",":paperclip:",":black_nib:",":pencil2:",":straight_ruler:",":triangular_ruler:",":closed_book:",":green_book:",":blue_book:",":orange_book:",":notebook:",":notebook_with_decorative_cover:",":ledger:",":books:",":bookmark:",":name_badge:",":microscope:",":telescope:",":newspaper:",":football:",":basketball:",":soccer:",":baseball:",":tennis:",":8ball:",":rugby_football:",":bowling:",":golf:",":mountain_bicyclist:",":bicyclist:",":horse_racing:",":snowboarder:",":swimmer:",":surfer:",":ski:",":spades:",":hearts:",":clubs:",":diamonds:",":gem:",":ring:",":trophy:",":musical_score:",":musical_keyboard:",":violin:",":space_invader:",":video_game:",":black_joker:",":flower_playing_cards:",":game_die:",":dart:",":mahjong:",":clapper:",":memo:",":pencil:",":book:",":art:",":microphone:",":headphones:",":trumpet:",":saxophone:",":guitar:",":shoe:",":sandal:",":high_heel:",":lipstick:",":boot:",":shirt:",":tshirt:",":necktie:",":womans_clothes:",":dress:",":running_shirt_with_sash:",":jeans:",":kimono:",":bikini:",":ribbon:",":tophat:",":crown:",":womans_hat:",":mans_shoe:",":closed_umbrella:",":briefcase:",":handbag:",":pouch:",":purse:",":eyeglasses:",":fishing_pole_and_fish:",":coffee:",":tea:",":sake:",":baby_bottle:",":beer:",":beers:",":cocktail:",":tropical_drink:",":wine_glass:",":fork_and_knife:",":pizza:",":hamburger:",":fries:",":poultry_leg:",":meat_on_bone:",":spaghetti:",":curry:",":fried_shrimp:",":bento:",":sushi:",":fish_cake:",":rice_ball:",":rice_cracker:",":rice:",":ramen:",":stew:",":oden:",":dango:",":egg:",":bread:",":doughnut:",":custard:",":icecream:",":ice_cream:",":shaved_ice:",":birthday:",":cake:",":cookie:",":chocolate_bar:",":candy:",":lollipop:",":honey_pot:",":apple:",":green_apple:",":tangerine:",":lemon:",":cherries:",":grapes:",":watermelon:",":strawberry:",":peach:",":melon:",":banana:",":pear:",":pineapple:",":sweet_potato:",":eggplant:",":tomato:",":corn:",":alien:",":angel:",":anger:",":angry:",":anguished:",":astonished:",":baby:",":blue_heart:",":blush:",":boom:",":bow:",":bowtie:",":boy:",":bride_with_veil:",":broken_heart:",":bust_in_silhouette:",":busts_in_silhouette:",":clap:",":cold_sweat:",":collision:",":confounded:",":confused:",":construction_worker:",":cop:",":couple_with_heart:",":couple:",":couplekiss:",":cry:",":crying_cat_face:",":cupid:",":dancer:",":dancers:",":dash:",":disappointed:",":dizzy_face:",":dizzy:",":droplet:",":ear:",":exclamation:",":expressionless:",":eyes:",":facepunch:",":family:",":fearful:",":feelsgood:",":feet:",":finnadie:",":fire:",":fist:",":flushed:",":frowning:",":girl:",":goberserk:",":godmode:",":green_heart:",":grey_exclamation:",":grey_question:",":grimacing:",":grin:",":grinning:",":guardsman:",":haircut:",":hand:",":hankey:",":hear_no_evil:",":heart_eyes_cat:",":heart_eyes:",":heart:",":heartbeat:",":heartpulse:",":hurtrealbad:",":hushed:",":imp:",":information_desk_person:",":innocent:",":japanese_goblin:",":japanese_ogre:",":joy_cat:",":joy:",":kiss:",":kissing_cat:",":kissing_closed_eyes:",":kissing_heart:",":kissing_smiling_eyes:",":kissing:",":laughing:",":lips:",":love_letter:",":man_with_gua_pi_mao:",":man_with_turban:",":man:",":mask:",":massage:",":metal:",":muscle:",":musical_note:",":nail_care:",":neckbeard:",":neutral_face:",":no_good:",":no_mouth:",":nose:",":notes:",":ok_hand:",":ok_woman:",":older_man:",":older_woman:",":open_hands:",":open_mouth:",":pensive:",":persevere:",":person_frowning:",":person_with_blond_hair:",":person_with_pouting_face:",":point_down:",":point_left:",":point_right:",":point_up_2:",":point_up:",":poop:",":pouting_cat:",":pray:",":princess:",":punch:",":purple_heart:",":question:",":rage:",":rage1:",":rage2:",":rage3:",":rage4:",":raised_hand:",":raised_hands:",":relaxed:",":relieved:",":revolving_hearts:",":runner:",":running:",":satisfied:",":scream_cat:",":scream:",":see_no_evil:",":shit:",":skull:",":sleeping:",":sleepy:",":smile_cat:",":smile:",":smiley_cat:",":smiley:",":smiling_imp:",":smirk_cat:",":smirk:",":sob:",":sparkling_heart:",":sparkles:",":speak_no_evil:",":speech_balloon:",":star:",":star2:",":stuck_out_tongue_closed_eyes:",":stuck_out_tongue_winking_eye:",":stuck_out_tongue:",":sunglasses:",":suspect:",":sweat_drops:",":sweat_smile:",":sweat:",":thought_balloon:",":-1:",":thumbsdown:",":thumbsup:",":+1:",":tired_face:",":tongue:",":triumph:",":trollface:",":two_hearts:",":two_men_holding_hands:",":two_women_holding_hands:",":unamused:",":v:",":walking:",":wave:",":weary:",":wink2:",":wink:",":woman:",":worried:",":yellow_heart:",":yum:",":zzz:",":109:",":house:",":house_with_garden:",":school:",":office:",":post_office:",":hospital:",":bank:",":convenience_store:",":love_hotel:",":hotel:",":wedding:",":church:",":department_store:",":european_post_office:",":city_sunrise:",":city_sunset:",":japanese_castle:",":european_castle:",":tent:",":factory:",":tokyo_tower:",":japan:",":mount_fuji:",":sunrise_over_mountains:",":sunrise:",":stars:",":statue_of_liberty:",":bridge_at_night:",":carousel_horse:",":rainbow:",":ferris_wheel:",":fountain:",":roller_coaster:",":ship:",":speedboat:",":boat:",":sailboat:",":rowboat:",":anchor:",":rocket:",":airplane:",":helicopter:",":steam_locomotive:",":tram:",":mountain_railway:",":bike:",":aerial_tramway:",":suspension_railway:",":mountain_cableway:",":tractor:",":blue_car:",":oncoming_automobile:",":car:",":red_car:",":taxi:",":oncoming_taxi:",":articulated_lorry:",":bus:",":oncoming_bus:",":rotating_light:",":police_car:",":oncoming_police_car:",":fire_engine:",":ambulance:",":minibus:",":truck:",":train:",":station:",":train2:",":bullettrain_front:",":bullettrain_side:",":light_rail:",":monorail:",":railway_car:",":trolleybus:",":ticket:",":fuelpump:",":vertical_traffic_light:",":traffic_light:",":warning:",":construction:",":beginner:",":atm:",":slot_machine:",":busstop:",":barber:",":hotsprings:",":checkered_flag:",":crossed_flags:",":izakaya_lantern:",":moyai:",":circus_tent:",":performing_arts:",":round_pushpin:",":triangular_flag_on_post:",":jp:",":kr:",":cn:",":us:",":fr:",":es:",":it:",":ru:",":gb:",":uk:",":de:",":100:",":1234:",":one:",":two:",":three:",":four:",":five:",":six:",":seven:",":eight:",":nine:",":keycap_ten:",":zero:",":hash:",":symbols:",":arrow_backward:",":arrow_down:",":arrow_forward:",":arrow_left:",":capital_abcd:",":abcd:",":abc:",":arrow_lower_left:",":arrow_lower_right:",":arrow_right:",":arrow_up:",":arrow_upper_left:",":arrow_upper_right:",":arrow_double_down:",":arrow_double_up:",":arrow_down_small:",":arrow_heading_down:",":arrow_heading_up:",":leftwards_arrow_with_hook:",":arrow_right_hook:",":left_right_arrow:",":arrow_up_down:",":arrow_up_small:",":arrows_clockwise:",":arrows_counterclockwise:",":rewind:",":fast_forward:",":information_source:",":ok:",":twisted_rightwards_arrows:",":repeat:",":repeat_one:",":new:",":top:",":up:",":cool:",":free:",":ng:",":cinema:",":koko:",":signal_strength:",":u5272:",":u5408:",":u55b6:",":u6307:",":u6708:",":u6709:",":u6e80:",":u7121:",":u7533:",":u7a7a:",":u7981:",":sa:",":restroom:",":mens:",":womens:",":baby_symbol:",":no_smoking:",":parking:",":wheelchair:",":metro:",":baggage_claim:",":accept:",":wc:",":potable_water:",":put_litter_in_its_place:",":secret:",":congratulations:",":m:",":passport_control:",":left_luggage:",":customs:",":ideograph_advantage:",":cl:",":sos:",":id:",":no_entry_sign:",":underage:",":no_mobile_phones:",":do_not_litter:",":non-potable_water:",":no_bicycles:",":no_pedestrians:",":children_crossing:",":no_entry:",":eight_spoked_asterisk:",":eight_pointed_black_star:",":heart_decoration:",":vs:",":vibration_mode:",":mobile_phone_off:",":chart:",":currency_exchange:",":aries:",":taurus:",":gemini:",":cancer:",":leo:",":virgo:",":libra:",":scorpius:",":sagittarius:",":capricorn:",":aquarius:",":pisces:",":ophiuchus:",":six_pointed_star:",":negative_squared_cross_mark:",":a:",":b:",":ab:",":o2:",":diamond_shape_with_a_dot_inside:",":recycle:",":end:",":on:",":soon:",":clock1:",":clock130:",":clock10:",":clock1030:",":clock11:",":clock1130:",":clock12:",":clock1230:",":clock2:",":clock230:",":clock3:",":clock330:",":clock4:",":clock430:",":clock5:",":clock530:",":clock6:",":clock630:",":clock7:",":clock730:",":clock8:",":clock830:",":clock9:",":clock930:",":heavy_dollar_sign:",":copyright:",":registered:",":tm:",":x:",":heavy_exclamation_mark:",":bangbang:",":interrobang:",":o:",":heavy_multiplication_x:",":heavy_plus_sign:",":heavy_minus_sign:",":heavy_division_sign:",":white_flower:",":heavy_check_mark:",":ballot_box_with_check:",":radio_button:",":link:",":curly_loop:",":wavy_dash:",":part_alternation_mark:",":trident:",":black_square:",":white_square:",":white_check_mark:",":black_square_button:",":white_square_button:",":black_circle:",":white_circle:",":red_circle:",":large_blue_circle:",":large_blue_diamond:",":large_orange_diamond:",":small_blue_diamond:",":small_orange_diamond:",":small_red_triangle:",":small_red_triangle_down:",":shipit:"];
|
12
|
+
var regrep = ":.+$";
|
13
|
+
|
14
|
+
function widgetPosition(){
|
15
|
+
var caretPosition = Measurement.caretPos($("textarea[name=body]"));
|
16
|
+
return {
|
17
|
+
left: caretPosition.left + "px",
|
18
|
+
top: caretPosition.top + 20 + "px",
|
19
|
+
width: "auto"
|
20
|
+
};
|
21
|
+
|
22
|
+
}
|
23
|
+
|
24
|
+
function matchedEmoji(val){
|
25
|
+
terms = val.split("\n");
|
26
|
+
term = terms[ terms.length - 1];
|
27
|
+
|
28
|
+
var matched = term.match(regrep);
|
29
|
+
|
30
|
+
if( matched == null ){
|
31
|
+
return false;
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
|
37
|
+
}
|
38
|
+
|
39
|
+
function typedEmoji( term ) {
|
40
|
+
var array = term.split(":");
|
41
|
+
return array[ array.length - 1 ];
|
42
|
+
}
|
43
|
+
|
44
|
+
$( "textarea[name=body]" )
|
45
|
+
.bind( "keydown", function( event ) {
|
46
|
+
if ( event.keyCode === $.ui.keyCode.TAB &&
|
47
|
+
$( this ).data( "autocomplete" ).menu.active ) {
|
48
|
+
event.preventDefault();
|
49
|
+
|
50
|
+
}
|
51
|
+
})
|
52
|
+
.autocomplete({
|
53
|
+
delay: 500,
|
54
|
+
|
55
|
+
//filtering
|
56
|
+
source: function( request, response ) {
|
57
|
+
if(matchedEmoji(request.term)){
|
58
|
+
response( $.ui.autocomplete.filter(
|
59
|
+
config.candidates, typedEmoji( request.term ) ) );
|
60
|
+
}
|
61
|
+
},
|
62
|
+
|
63
|
+
// prevent value inserted on focus
|
64
|
+
focus: function() {
|
65
|
+
return false;
|
66
|
+
},
|
67
|
+
|
68
|
+
// replace textarea
|
69
|
+
select: function( event, ui ) {
|
70
|
+
// no match data ...
|
71
|
+
if (ui.item.value == null){
|
72
|
+
return false;
|
73
|
+
}
|
74
|
+
|
75
|
+
var terms = this.value.split(":");
|
76
|
+
// remove the current typed emoji
|
77
|
+
terms.pop();
|
78
|
+
// add the selected item
|
79
|
+
terms.push( ui.item.value.replace(/:/g, "") );
|
80
|
+
this.value = terms.join( ":" ) + ":";
|
81
|
+
|
82
|
+
return false;
|
83
|
+
},
|
84
|
+
|
85
|
+
// re-positioning supports excluding IE.
|
86
|
+
open: function(){
|
87
|
+
if (! document.uniqueID) {
|
88
|
+
$(".ui-autocomplete").css(widgetPosition())
|
89
|
+
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
})
|
94
|
+
|
95
|
+
// customize autocomplate item
|
96
|
+
$.ui.autocomplete.prototype._renderItem = function( ul, item ) {
|
97
|
+
var icon_img = null;
|
98
|
+
|
99
|
+
if (item.value != null){
|
100
|
+
png_basename = item.value.replace(/:/g, "");
|
101
|
+
|
102
|
+
if (png_basename == '+1'){ png_basename = 'plus1' }
|
103
|
+
|
104
|
+
icon_img = $("<img>").attr('src', 'http://www.emoji-cheat-sheet.com/graphics/emojis/' + png_basename + '.png')
|
105
|
+
.css('width', '20').css('height', '20');
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
var label_a = $("<a></a>")
|
110
|
+
.append(icon_img)
|
111
|
+
.append(item.label)
|
112
|
+
|
113
|
+
return $( "<li></li>" )
|
114
|
+
.data( "item.autocomplete", item )
|
115
|
+
.append(label_a)
|
116
|
+
.appendTo( ul );
|
117
|
+
};
|
118
|
+
|
119
|
+
// customize filter and result
|
120
|
+
$.ui.autocomplete.filter = function(array, term) {
|
121
|
+
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
|
122
|
+
|
123
|
+
var aryMatches = $.grep( array, function(value) {
|
124
|
+
return matcher.test(value.label || value.value || value);
|
125
|
+
|
126
|
+
});
|
127
|
+
|
128
|
+
if (aryMatches.length == 0){
|
129
|
+
aryMatches.push({
|
130
|
+
label: '<span class="info" style="font-style: italic;">no match found</span>',
|
131
|
+
value: null
|
132
|
+
});
|
133
|
+
|
134
|
+
}
|
135
|
+
|
136
|
+
return aryMatches;
|
137
|
+
};
|
138
|
+
});
|
139
|
+
|
data/misc/migrate.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gem 'rake'
|
4
4
|
|
@@ -8,8 +8,11 @@ gem 'sprockets'
|
|
8
8
|
gem 'omniauth'
|
9
9
|
gem 'omniauth-twitter'
|
10
10
|
gem 'omniauth-github'
|
11
|
+
gem 'twitter-text', :require => false
|
11
12
|
|
12
13
|
gem 'dalli'
|
14
|
+
gem 'redis'
|
15
|
+
gem 'redis-namespace'
|
13
16
|
|
14
17
|
gem 'coffee-script'
|
15
18
|
gem 'therubyracer'
|
@@ -7,6 +7,7 @@ GEM
|
|
7
7
|
execjs
|
8
8
|
coffee-script-source (1.3.3)
|
9
9
|
daemons (1.1.9)
|
10
|
+
dalli (2.6.3)
|
10
11
|
eventmachine (1.0.0)
|
11
12
|
execjs (1.4.0)
|
12
13
|
multi_json (~> 1.0)
|
@@ -50,6 +51,9 @@ GEM
|
|
50
51
|
rack (1.4.1)
|
51
52
|
rake (0.9.2.2)
|
52
53
|
redcarpet (2.1.1)
|
54
|
+
redis (3.0.4)
|
55
|
+
redis-namespace (1.3.0)
|
56
|
+
redis (~> 3.0.0)
|
53
57
|
sequel (3.40.0)
|
54
58
|
sprockets (2.6.0)
|
55
59
|
hike (~> 1.2)
|
@@ -63,6 +67,11 @@ GEM
|
|
63
67
|
eventmachine (>= 0.12.6)
|
64
68
|
rack (>= 1.0.0)
|
65
69
|
tilt (1.3.3)
|
70
|
+
twitter-text (1.6.1)
|
71
|
+
unf (~> 0.0.5)
|
72
|
+
unf (0.0.5)
|
73
|
+
unf_ext
|
74
|
+
unf_ext (0.0.6)
|
66
75
|
yajl-ruby (1.1.0)
|
67
76
|
|
68
77
|
PLATFORMS
|
@@ -71,6 +80,7 @@ PLATFORMS
|
|
71
80
|
DEPENDENCIES
|
72
81
|
cf-runtime
|
73
82
|
coffee-script
|
83
|
+
dalli
|
74
84
|
omniauth
|
75
85
|
omniauth-github
|
76
86
|
omniauth-twitter
|
@@ -79,7 +89,10 @@ DEPENDENCIES
|
|
79
89
|
rack
|
80
90
|
rake
|
81
91
|
redcarpet
|
92
|
+
redis
|
93
|
+
redis-namespace
|
82
94
|
sequel
|
83
95
|
sprockets
|
84
96
|
therubyracer
|
85
97
|
thin
|
98
|
+
twitter-text
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
@data_path = Dir.tmpdir
|
3
3
|
|
4
|
-
|
5
|
-
psql_options = CFRuntime::PGClient.options_for_svc(
|
4
|
+
psql_services = CFRuntime::CloudApp.service_names_of_type('postgresql')
|
5
|
+
psql_options = CFRuntime::PGClient.options_for_svc(psql_services[0])
|
6
6
|
@database_url = "postgres://#{psql_options[:user]}:#{psql_options[:password]}@#{psql_options[:host]}:#{psql_options[:port]}/#{psql_options[:dbname]}"
|
7
7
|
|
8
8
|
@style = 'GFM'
|
9
9
|
|
10
|
-
require 'tdiary/io/cache/
|
10
|
+
require 'tdiary/io/cache/file'
|
11
11
|
require 'tdiary/io/rdb'
|
12
12
|
@io_class = TDiary::RdbIO
|
13
13
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# comment_emoji_autocomplete.rb : Support the automatic input of the emoji
|
4
|
+
# using jQuery UI autocomplete.
|
5
|
+
#
|
6
|
+
# Copyright (C) 2013, tamoot <tamoot+tdiary@gmail.com>
|
7
|
+
# You can redistribute it and/or modify it under GPL2.
|
8
|
+
#
|
9
|
+
|
10
|
+
if !@cgi.mobile_agent? && /\A(?:day)\z/ =~ @mode
|
11
|
+
add_header_proc do
|
12
|
+
%Q|<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"/>|
|
13
|
+
end
|
14
|
+
|
15
|
+
enable_js('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js')
|
16
|
+
enable_js('caretposition.js')
|
17
|
+
enable_js('comment_emoji_autocomplete.js')
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
# Local Variables:
|
22
|
+
# mode: ruby
|
23
|
+
# indent-tabs-mode: t
|
24
|
+
# tab-width: 3
|
25
|
+
# ruby-indent-level: 3
|
26
|
+
# End:
|
27
|
+
# vim: ts=3
|
data/misc/style/gfm/gfm_style.rb
CHANGED
data/plugin/50sp.rb
CHANGED
@@ -8,6 +8,9 @@ SP_PREFIX = 'sp'
|
|
8
8
|
end
|
9
9
|
@sp_path << "#{TDiary::PATH}/misc/plugin" if @sp_path.include?('misc/plugin')
|
10
10
|
|
11
|
+
# FIXME: dirty hack, it should create TDiary::Server::Config.plugin_path
|
12
|
+
TDiary::Contrib::Plugin.setup( @sp_path ) if defined?(TDiary::Contrib)
|
13
|
+
|
11
14
|
# get plugin option
|
12
15
|
def sp_option( key )
|
13
16
|
@conf["#{SP_PREFIX}.#{key}"]
|
data/tdiary/admin.rb
CHANGED
@@ -73,7 +73,7 @@ module TDiary
|
|
73
73
|
|
74
74
|
@title = @cgi.params['title'][0]
|
75
75
|
@body = @cgi.params['body'][0]
|
76
|
-
if @cgi.mobile_agent?
|
76
|
+
if @cgi.mobile_agent?
|
77
77
|
@title.force_encoding(@conf.mobile_encoding)
|
78
78
|
@body.force_encoding(@conf.mobile_encoding)
|
79
79
|
end
|
@@ -113,7 +113,7 @@ module TDiary
|
|
113
113
|
def initialize( cgi, rhtml, conf )
|
114
114
|
@title = cgi.params['title'][0]
|
115
115
|
@body = cgi.params['body'][0]
|
116
|
-
if cgi.mobile_agent?
|
116
|
+
if cgi.mobile_agent?
|
117
117
|
@title.force_encoding(conf.mobile_encoding)
|
118
118
|
@body.force_encoding(conf.mobile_encoding)
|
119
119
|
end
|
data/tdiary/base.rb
CHANGED
@@ -125,11 +125,9 @@ module TDiary
|
|
125
125
|
|
126
126
|
begin
|
127
127
|
r = ERB.new(rhtml.untaint).result(binding)
|
128
|
-
rescue => e
|
128
|
+
rescue ::Encoding::CompatibilityError => e
|
129
129
|
# migration error on ruby 1.9 only 1st time, reload.
|
130
|
-
|
131
|
-
raise ForceRedirect.new(base_url)
|
132
|
-
end
|
130
|
+
raise ForceRedirect.new(base_url)
|
133
131
|
end
|
134
132
|
ERB.new(r).src
|
135
133
|
end
|
data/tdiary/cli.rb
CHANGED
@@ -12,15 +12,21 @@ module TDiary
|
|
12
12
|
end
|
13
13
|
|
14
14
|
desc "new DIR_NAME", "Create a new tDiary directory"
|
15
|
+
method_option "skip-bundle", :type => :boolean, :banner =>
|
16
|
+
"don't run bundle and .htpasswd generation"
|
15
17
|
def new(name)
|
16
18
|
target = File.join(Dir.pwd, name)
|
17
19
|
deploy(target)
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
unless options[:'skip-bundle']
|
22
|
+
Bundler.with_clean_env do
|
23
|
+
inside(target) do
|
24
|
+
run('bundle install --without test development')
|
25
|
+
run('bundle exec tdiary htpasswd')
|
26
|
+
end
|
23
27
|
end
|
28
|
+
else
|
29
|
+
say "run `bundle install && bundle exec tdiary htpasswd` manually", :red
|
24
30
|
end
|
25
31
|
say 'install finished', :green
|
26
32
|
say "run `tdiary server` in #{name} directory to start server", :green
|
@@ -47,20 +53,35 @@ module TDiary
|
|
47
53
|
"start server with rack interface (default)"
|
48
54
|
method_option "cgi", :type => :string, :banner =>
|
49
55
|
"start server with cgi interface"
|
56
|
+
method_option "bind", :aliases => "b", :type => :string, :default => "0.0.0.0", :banner =>
|
57
|
+
"bind to the IP"
|
58
|
+
method_option "port", :aliases => "p", :type => :numeric, :default => 19292, :banner =>
|
59
|
+
"use PORT"
|
50
60
|
def server
|
51
61
|
if options[:cgi]
|
52
62
|
opts = {
|
53
63
|
:daemon => ENV['DAEMON'],
|
54
|
-
:bind =>
|
55
|
-
:port =>
|
64
|
+
:bind => options[:bind],
|
65
|
+
:port => options[:port],
|
56
66
|
:logger => $stderr,
|
57
67
|
:access_log => $stderr,
|
58
68
|
}
|
59
69
|
TDiary::Server.run( opts )
|
60
70
|
elsif
|
61
71
|
# --rack option
|
62
|
-
|
63
|
-
|
72
|
+
require 'rack'
|
73
|
+
# Rack::Server reads ARGV as :config, so delete it
|
74
|
+
ARGV.shift
|
75
|
+
opts = {
|
76
|
+
:environment => ENV['RACK_ENV'] || "development",
|
77
|
+
:daemonize => false,
|
78
|
+
:Host => options[:bind],
|
79
|
+
:Port => options[:port],
|
80
|
+
:pid => File.expand_path("tdiary.pid"),
|
81
|
+
:AccessLog => $stderr,
|
82
|
+
:config => File.expand_path("config.ru")
|
83
|
+
}
|
84
|
+
Rack::Server.start( opts )
|
64
85
|
end
|
65
86
|
end
|
66
87
|
|
@@ -101,6 +122,7 @@ module TDiary
|
|
101
122
|
%w(
|
102
123
|
README.md
|
103
124
|
Gemfile
|
125
|
+
Gemfile.lock
|
104
126
|
config.ru
|
105
127
|
tdiary.conf.beginner
|
106
128
|
tdiary.conf.sample
|
data/tdiary/compatible.rb
CHANGED
@@ -17,50 +17,55 @@ end
|
|
17
17
|
|
18
18
|
# for Ruby 1.9.X
|
19
19
|
|
20
|
+
# preload transcodes outside $SAFE=4 environment, that is a workaround
|
21
|
+
# for the possible SecurityError. see the following uri for the detail.
|
22
|
+
# http://redmine.ruby-lang.org/issues/5279
|
23
|
+
%w(utf-16be euc-jp iso-2022-jp Shift_JIS).each do |enc|
|
24
|
+
"\uFEFF".encode(enc) rescue nil
|
25
|
+
end
|
26
|
+
|
20
27
|
# Auto convert ASCII_8BIT pstore data (created by Ruby-1.8) to UTF-8.
|
21
|
-
|
22
|
-
|
23
|
-
class PStoreRuby18Exception < Exception; end
|
28
|
+
require 'pstore'
|
29
|
+
class PStoreRuby18Exception < Exception; end
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
obj
|
39
|
-
})
|
40
|
-
table[:__ruby_version] = RUBY_VERSION
|
41
|
-
if on_windows?
|
42
|
-
save_data_with_fast_strategy(Marshal::dump(table), file)
|
43
|
-
else
|
44
|
-
save_data_with_atomic_file_rename_strategy(Marshal::dump(table), file)
|
31
|
+
class PStore
|
32
|
+
alias compatible_transaction_original transaction unless defined?(compatible_transaction_original)
|
33
|
+
def transaction(*args, &block)
|
34
|
+
begin
|
35
|
+
compatible_transaction_original(*args, &block)
|
36
|
+
rescue PStoreRuby18Exception => e
|
37
|
+
# first loaded the pstore file (it's created by Ruby-1.8)
|
38
|
+
# force convert ASCII_8BIT pstore data to UTF_8
|
39
|
+
file = open_and_lock_file(@filename, false)
|
40
|
+
table = Marshal::load(file, proc {|obj|
|
41
|
+
if obj.respond_to?('force_encoding') && obj.encoding == Encoding::ASCII_8BIT
|
42
|
+
obj.force_encoding('UTF-8')
|
45
43
|
end
|
46
|
-
|
44
|
+
obj
|
45
|
+
})
|
46
|
+
table[:__ruby_version] = RUBY_VERSION
|
47
|
+
if on_windows?
|
48
|
+
save_data_with_fast_strategy(Marshal::dump(table), file)
|
49
|
+
else
|
50
|
+
save_data_with_atomic_file_rename_strategy(Marshal::dump(table), file)
|
47
51
|
end
|
52
|
+
retry
|
48
53
|
end
|
54
|
+
end
|
49
55
|
|
50
|
-
|
56
|
+
private
|
51
57
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
58
|
+
def load(content)
|
59
|
+
table = Marshal::load(content)
|
60
|
+
raise PStoreRuby18Exception.new if !table[:__ruby_version] || table[:__ruby_version] < '1.9'
|
61
|
+
# hide __ruby_version to caller
|
62
|
+
table.delete(:__ruby_version)
|
63
|
+
table
|
64
|
+
end
|
59
65
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
66
|
+
def dump(table)
|
67
|
+
table[:__ruby_version] = RUBY_VERSION
|
68
|
+
Marshal::dump(table)
|
64
69
|
end
|
65
70
|
end
|
66
71
|
|
data/tdiary/config.rb
CHANGED
@@ -65,50 +65,18 @@ module TDiary
|
|
65
65
|
@options2.delete( key )
|
66
66
|
end
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
%w(utf-16be euc-jp iso-2022-jp Shift_JIS).each do |enc|
|
73
|
-
"\uFEFF".encode(enc) rescue nil
|
68
|
+
def to_native( str, charset = nil )
|
69
|
+
str = str.dup
|
70
|
+
if str.encoding == Encoding::ASCII_8BIT
|
71
|
+
str.force_encoding(charset || 'utf-8')
|
74
72
|
end
|
75
|
-
|
76
|
-
|
77
|
-
str = str.dup
|
78
|
-
if str.encoding == Encoding::ASCII_8BIT
|
79
|
-
str.force_encoding(charset || 'utf-8')
|
80
|
-
end
|
81
|
-
unless str.valid_encoding?
|
82
|
-
str.encode!('utf-16be', {:invalid => :replace, :undef => :replace})
|
83
|
-
end
|
84
|
-
unless str.encoding == Encoding::UTF_8
|
85
|
-
str.encode!('utf-8', {:invalid => :replace, :undef => :replace})
|
86
|
-
end
|
87
|
-
str
|
73
|
+
unless str.valid_encoding?
|
74
|
+
str.encode!('utf-16be', {:invalid => :replace, :undef => :replace})
|
88
75
|
end
|
89
|
-
|
90
|
-
|
91
|
-
require 'iconv'
|
92
|
-
require 'nkf'
|
93
|
-
|
94
|
-
def to_native( str, charset = nil )
|
95
|
-
return str if Kconv.isutf8(str)
|
96
|
-
begin
|
97
|
-
Iconv.conv('utf-8', charset || 'utf-8', str)
|
98
|
-
rescue
|
99
|
-
from = case charset
|
100
|
-
when /^utf-8$/i
|
101
|
-
'W'
|
102
|
-
when /^shift_jis/i
|
103
|
-
'S'
|
104
|
-
when /^EUC-JP/i
|
105
|
-
'E'
|
106
|
-
else
|
107
|
-
''
|
108
|
-
end
|
109
|
-
NKF::nkf("-m0 -#{from}w", str)
|
110
|
-
end
|
76
|
+
unless str.encoding == Encoding::UTF_8
|
77
|
+
str.encode!('utf-8', {:invalid => :replace, :undef => :replace})
|
111
78
|
end
|
79
|
+
str
|
112
80
|
end
|
113
81
|
|
114
82
|
private
|
data/tdiary/lang/ja.rb
CHANGED
@@ -22,29 +22,12 @@ def mobile_encoding
|
|
22
22
|
'Shift_JIS'
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
def to_mail( str )
|
31
|
-
str.encode('iso-2022-jp', {:invalid => :replace, :undef => :replace})
|
32
|
-
end
|
33
|
-
else
|
34
|
-
require 'nkf'
|
35
|
-
require 'iconv'
|
36
|
-
|
37
|
-
def to_mobile( str )
|
38
|
-
NKF::nkf( '-m0 -W -s', str )
|
39
|
-
end
|
25
|
+
def to_mobile( str )
|
26
|
+
str.encode(mobile_encoding, {:invalid => :replace, :undef => :replace})
|
27
|
+
end
|
40
28
|
|
41
|
-
|
42
|
-
|
43
|
-
Iconv.conv('iso-2022-jp', 'utf-8', str)
|
44
|
-
rescue
|
45
|
-
NKF::nkf('-m0 -W -j', str)
|
46
|
-
end
|
47
|
-
end
|
29
|
+
def to_mail( str )
|
30
|
+
str.encode('iso-2022-jp', {:invalid => :replace, :undef => :replace})
|
48
31
|
end
|
49
32
|
|
50
33
|
def migrate_to_utf8( str )
|
data/tdiary/referer_manager.rb
CHANGED
@@ -24,8 +24,8 @@ module TDiary
|
|
24
24
|
end
|
25
25
|
begin
|
26
26
|
uref = CGI::unescape( ref )
|
27
|
-
rescue => e
|
28
|
-
return
|
27
|
+
rescue ::Encoding::CompatibilityError => e
|
28
|
+
return
|
29
29
|
end
|
30
30
|
if pair = @referers[uref] then
|
31
31
|
pair = [pair, ref] if pair.class != Array # for compatibility
|
data/tdiary/version.rb
CHANGED
data/tdiary/view.rb
CHANGED
@@ -185,7 +185,7 @@ module TDiary
|
|
185
185
|
@name = @cgi.params['name'][0]
|
186
186
|
@mail = @cgi.params['mail'][0]
|
187
187
|
@body = @cgi.params['body'][0]
|
188
|
-
if @cgi.mobile_agent?
|
188
|
+
if @cgi.mobile_agent?
|
189
189
|
@name.force_encoding(conf.mobile_encoding)
|
190
190
|
@body.force_encoding(conf.mobile_encoding)
|
191
191
|
end
|
data/tdiary.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["."]
|
20
20
|
|
21
|
+
spec.required_ruby_version = '>= 1.9.2'
|
22
|
+
|
21
23
|
spec.add_dependency 'thor', '~> 0.18'
|
22
24
|
spec.add_dependency "bundler", "~> 1.3"
|
23
25
|
end
|
data/tdiary.rb
CHANGED
@@ -12,11 +12,7 @@ TDIARY_VERSION = TDiary::VERSION
|
|
12
12
|
|
13
13
|
$:.unshift File.join(File::dirname(__FILE__), '/misc/lib').untaint
|
14
14
|
Dir["#{File::dirname(__FILE__) + '/vendor/*/lib'}"].each {|dir| $:.unshift dir.untaint }
|
15
|
-
|
16
|
-
Encoding::default_external = 'UTF-8'
|
17
|
-
rescue NameError
|
18
|
-
$KCODE = 'n'
|
19
|
-
end
|
15
|
+
Encoding::default_external = 'UTF-8'
|
20
16
|
|
21
17
|
require 'cgi'
|
22
18
|
require 'uri'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdiary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.2.
|
4
|
+
version: 3.2.2.20130518
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TADA Tadashi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -51,7 +51,6 @@ files:
|
|
51
51
|
- .coveralls.yml
|
52
52
|
- .gitignore
|
53
53
|
- .travis.yml
|
54
|
-
- Capfile
|
55
54
|
- ChangeLog
|
56
55
|
- Gemfile
|
57
56
|
- Gemfile.lock
|
@@ -89,6 +88,7 @@ files:
|
|
89
88
|
- js/category.js
|
90
89
|
- js/category_autocomplete.js
|
91
90
|
- js/comment_ajax.js
|
91
|
+
- js/comment_emoji_autocomplete.js
|
92
92
|
- js/draft.js
|
93
93
|
- js/highlight.js
|
94
94
|
- js/image.js
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- misc/plugin/category.rb
|
131
131
|
- misc/plugin/category_autocomplete.rb
|
132
132
|
- misc/plugin/comment_ajax.rb
|
133
|
+
- misc/plugin/comment_emoji_autocomplete.rb
|
133
134
|
- misc/plugin/comment_mail-qmail.rb
|
134
135
|
- misc/plugin/comment_mail-sendmail.rb
|
135
136
|
- misc/plugin/comment_mail-smtp.rb
|
@@ -268,9 +269,6 @@ files:
|
|
268
269
|
- plugin/ja/50sp.rb
|
269
270
|
- plugin/ja/60sf.rb
|
270
271
|
- public/.gitkeep
|
271
|
-
- public/images/.gitkeep
|
272
|
-
- public/javascripts/.gitkeep
|
273
|
-
- public/stylesheets/.gitkeep
|
274
272
|
- skel/category.rhtml
|
275
273
|
- skel/conf.rhtml
|
276
274
|
- skel/day.rhtml
|
@@ -362,7 +360,6 @@ files:
|
|
362
360
|
- tdiary/compatible.rb
|
363
361
|
- tdiary/config.rb
|
364
362
|
- tdiary/core_ext.rb
|
365
|
-
- tdiary/deploy.rb
|
366
363
|
- tdiary/dispatcher.rb
|
367
364
|
- tdiary/dispatcher/index_main.rb
|
368
365
|
- tdiary/dispatcher/update_main.rb
|
@@ -570,7 +567,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
570
567
|
requirements:
|
571
568
|
- - '>='
|
572
569
|
- !ruby/object:Gem::Version
|
573
|
-
version:
|
570
|
+
version: 1.9.2
|
574
571
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
575
572
|
requirements:
|
576
573
|
- - '>='
|
@@ -578,7 +575,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
578
575
|
version: '0'
|
579
576
|
requirements: []
|
580
577
|
rubyforge_project:
|
581
|
-
rubygems_version: 2.0.
|
578
|
+
rubygems_version: 2.0.2
|
582
579
|
signing_key:
|
583
580
|
specification_version: 4
|
584
581
|
summary: a TSUKKOMI-able Web-log
|
data/Capfile
DELETED
data/public/images/.gitkeep
DELETED
File without changes
|
data/public/javascripts/.gitkeep
DELETED
File without changes
|
data/public/stylesheets/.gitkeep
DELETED
File without changes
|
data/tdiary/deploy.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'capistrano_colors'
|
4
|
-
|
5
|
-
require 'rvm/capistrano'
|
6
|
-
set :rvm_type, :system
|
7
|
-
|
8
|
-
require 'pit'
|
9
|
-
config = Pit.get('tdiary', :require => {
|
10
|
-
:username => 'your username',
|
11
|
-
:server => 'your server address'
|
12
|
-
})
|
13
|
-
|
14
|
-
set :application, 'tdiary'
|
15
|
-
|
16
|
-
set :scm, :git
|
17
|
-
set :repository, 'git://github.com/tdiary/tdiary-core.git'
|
18
|
-
set :branch, 'master'
|
19
|
-
set :deploy_via, :remote_cache
|
20
|
-
|
21
|
-
server config[:server], :app
|
22
|
-
|
23
|
-
set :user, config[:username]
|
24
|
-
set :deploy_to, defer { "/home/#{user}/app/#{application}" }
|
25
|
-
|
26
|
-
namespace :deploy do
|
27
|
-
task :start do ; end
|
28
|
-
task :stop do ; end
|
29
|
-
task :restart, :roles => :app, :except => { :no_release => true } do
|
30
|
-
run "touch #{File.join(current_path, 'tmp', 'restart.txt')}"
|
31
|
-
end
|
32
|
-
|
33
|
-
desc 'update shared library'
|
34
|
-
task :update_library, :roles => :app do
|
35
|
-
run "cp -r #{shared_path}/lib/* #{latest_release}/misc/lib"
|
36
|
-
run "cp -r #{shared_path}/js/* #{latest_release}/js"
|
37
|
-
end
|
38
|
-
|
39
|
-
after 'deploy:finalize_update', 'deploy:update_library'
|
40
|
-
after 'deploy:update', 'deploy:cleanup'
|
41
|
-
end
|
42
|
-
|
43
|
-
namespace :httpd do
|
44
|
-
[:stop, :start, :restart, :reload].each do |action|
|
45
|
-
desc "#{action.to_s.capitalize} Apache"
|
46
|
-
task action, :roles => :app do
|
47
|
-
invoke_command "/etc/init.d/apache2 #{action.to_s}", :via => run_method
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|