[DRE-commits] [tdiary] 01/04: Imported Upstream version 4.2.1
Youhei SASAKI
uwabami-guest at moszumanska.debian.org
Mon Jan 18 07:47:48 UTC 2016
This is an automated email from the git hooks/post-receive script.
uwabami-guest pushed a commit to branch master
in repository tdiary.
commit 6da33cbaebe5d3cb4aaa7f84ee06b63e9de5222e
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date: Mon Jan 18 16:34:52 2016 +0900
Imported Upstream version 4.2.1
---
.gitignore | 1 -
.travis.yml | 3 +-
ChangeLog | 45 ++++++++++++----
Gemfile | 7 +--
Gemfile.lock | 92 ++++++++++++++------------------
Gruntfile.js | 24 ---------
bower.json | 19 -------
config.ru | 3 +-
js/02edit.coffee | 5 --
lib/tdiary/application.rb | 61 +++++++++++++++------
lib/tdiary/application/configuration.rb | 31 -----------
lib/tdiary/configuration.rb | 4 +-
lib/tdiary/core_ext.rb | 6 +--
lib/tdiary/rack/assets/precompile.rb | 37 -------------
lib/tdiary/rack/auth/omniauth.rb | 9 ++--
lib/tdiary/tasks/assets.rake | 11 ----
lib/tdiary/tasks/release.rake | 25 +++------
lib/tdiary/version.rb | 2 +-
misc/plugin/category.rb | 8 +--
package.json | 8 ++-
spec/core/application_spec.rb | 10 +++-
spec/core/core_ext_spec.rb | 2 +-
spec/core/rack/assets/precompile_spec.rb | 75 --------------------------
spec/javascripts/support/jasmine.yml | 4 +-
tdiary.gemspec | 22 ++++++--
theme/default/default.css | 9 +++-
26 files changed, 185 insertions(+), 338 deletions(-)
diff --git a/.gitignore b/.gitignore
index 9d6b1d0..c551452 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,5 +16,4 @@ doc/*.html
.rspec
/Gemfile.local
spec/javascripts/lib
-bower_components
node_modules
diff --git a/.travis.yml b/.travis.yml
index 53b61fb..e0b1d42 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,13 +8,13 @@ rvm:
- 2.0.0
- 2.1
- 2.2
+ - 2.3.0
- ruby-head
cache:
bundler: true
directories:
- node_modules
- - bower_components
# ignored --deployment option
bundler_args: "--without server --jobs=3 --retry=3"
@@ -24,7 +24,6 @@ before_install:
before_script:
- npm install
- - grunt
script: if [ $TEST_MODE = "gem" ] ; then bundle exec tdiary test ; else bundle exec rake spec jasmine:ci test ; fi
diff --git a/ChangeLog b/ChangeLog
index dc81442..f1802fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2015-12-29 MATSUOKA Kohei <kohei at machu.jp>
+ * release 4.2.1
+
+2015-12-25 MATSUOKA Kohei <kohei at machu.jp>
+ * revert 61b7b6: writing dependency in gemspec, see #527
+
+2015-12-25 TADA Tadashi <t at tdtds.jp>
+ * default.css: more adjust CSS for mobile devices
+
+2015-12-08 MATSUOKA Kohei <kohei at machu.jp>
+ * fix #494 authentication error by omniauth and rack::session::pool
+
+2015-12-01 MATSUOKA Kohei <kohei at machu.jp>
+ * enable to write TDiary::Application settings in tdiary.conf (@index, @update, @options['base_url'])
+
+2015-11-26 MATSUOKA Kohei <kohei at machu.jp>
+ * move gems dependency from Gemfile to .gemspec
+ * specify spec.files without git command
+ * remove specs from gem
+
+2015-09-29 SHIBATA Hiroshi <shibata.hiroshi at gmail.com>
+ * release 4.2.0
+
2015-06-29 MATSUOKA Kohei <kohei at machu.jp>
* release 4.1.3
* Gemfile: use rack 1.6.4 which sepatates params with ';'. see #485
@@ -55,7 +78,7 @@
2014-12-27 MATSUOKA Kohei <kohei at machu.jp>
* lib/tdiary/application.rb: fix #442: call extensions setup before the core setup
- * lib/tdiary/application/extensions/omniauth.rb: fix error with base_dir
+ * lib/tdiary/application/extensions/omniauth.rb: fix error with base_dir
* lib/tdiary/rack/auth/omniauth.rb: remove github authentication
2014-12-22 SHIBATA Hiroshi <shibata.hiroshi at gmail.com>
@@ -724,9 +747,9 @@
* plugin/00default.rb: fixed bug of no saved referer under new navi_user plugin.
2009-11-24 SHIBATA Hiroshi <shibata.hiroshi at gmail.com>
- * tdiary.rb, plugin/00default.rb,
+ * tdiary.rb, plugin/00default.rb,
plugin/{ja,en,zh}/00default.rb: change logger implementation.
- * tdiary.rb, plugin/00default.rb: change implemention of
+ * tdiary.rb, plugin/00default.rb: change implemention of
navi_user_day to navi_user.rb.
2009-08-26 Kazuhiko <kazuhiko at fdiary.net>
@@ -878,7 +901,7 @@
* **/*.rb: insert magic comment.
2008-11-17 SHIBATA Hiroshi <shibata.hiroshi at gmail.com>
- * index.rb, update.rb: replaced $defout to $stdout. ($defout is obsolete in ruby1.8)
+ * index.rb, update.rb: replaced $defout to $stdout. ($defout is obsolete in ruby1.8)
2008-10-31 SHIBATA Hiroshi <shibata.hiroshi at gmail.com>
* plugin/00default.rb: escaped comment_form_text. thx fudan.
@@ -955,7 +978,7 @@
* skel/footer.rhtml: using rescue on display to RUBY_PATCHLEVEL.
2008-06-23 SHIBATA Hiroshi <shibata.hiroshi at gmail.com>
- * tdiary.rb: add 'Semulator', 'Vemulator', 'J-EMULATOR' and 'emobile' to
+ * tdiary.rb: add 'Semulator', 'Vemulator', 'J-EMULATOR' and 'emobile' to
mobile user agent.
* skel/footer.rhtml: display RUBY_PATCHLEVEL in footer.
@@ -1310,7 +1333,7 @@
2006-11-11 Tanaka Akira <akr at fsij.org>
* tdiary/wiki_style.rb: support here document ends without CR/LF in plugin.
-
+
2006-11-10 TADA Tadashi <sho at spc.gr.jp>
* style/wiki_style.rb: fix bug when plugin specified in subtitle.
@@ -1320,13 +1343,13 @@
2006-11-06 Tanaka Akira <akr at fsij.org>
* tdiary/hikidoc.rb, tdiary/wiki_style.rb: support here document in wiki
style plugin syntax.
-
-2006-09-13 Shun-ichi TAHARA <jado at flowernet.gr.jp>
+
+2006-09-13 Shun-ichi TAHARA <jado at flowernet.gr.jp>
* style/etdiary/etdiary_style.rb: fix bug for mobile mode.
-
-2006-09-13 Masahiro Sakai <sakai at tom.sfc.keio.ac.jp>
+
+2006-09-13 Masahiro Sakai <sakai at tom.sfc.keio.ac.jp>
* style/rd/rd_style.rb: unescapeHTML for parameters of plugins.
-
+
2006-09-05 TADA Tadashi <sho at spc.gr.jp>
* skel/i.*.rhtml: add navigation link to bottom of pages.
diff --git a/Gemfile b/Gemfile
index 5d2d7b0..ef4363d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,14 +4,9 @@ gem 'rack'
gem 'sprockets'
gem 'hikidoc'
gem 'fastimage'
-gem 'gemoji'
+gem 'emot'
gem 'mail'
-group :coffee do
- gem 'coffee-script'
- gem 'therubyracer'
-end
-
group :development do
gem 'pit', require: false
gem 'racksh', require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index 3ea3c14..049640e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,23 +1,18 @@
GEM
remote: https://rubygems.org/
specs:
- addressable (2.3.8)
- byebug (5.0.0)
- columnize (= 0.9.0)
+ addressable (2.4.0)
+ byebug (8.2.1)
capybara (2.5.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
- childprocess (0.5.6)
+ childprocess (0.5.8)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
- coffee-script (2.4.1)
- coffee-script-source
- execjs
- coffee-script-source (1.9.1.1)
- columnize (0.9.0)
+ concurrent-ruby (1.0.0)
coveralls (0.7.12)
multi_json (~> 1.10)
rest-client (>= 1.6.8, < 2)
@@ -26,43 +21,42 @@ GEM
thor (~> 0.19.1)
diff-lcs (1.2.5)
docile (1.1.5)
- domain_name (0.5.24)
+ domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
- execjs (2.6.0)
- fastimage (1.7.0)
+ emot (0.0.4)
+ thor
+ fastimage (1.8.1)
addressable (~> 2.3, >= 2.3.5)
ffi (1.9.10)
- gemoji (2.1.0)
hikidoc (0.1.0)
http-cookie (1.0.2)
domain_name (~> 0.5)
- jasmine (2.3.1)
- jasmine-core (~> 2.3)
+ jasmine (2.4.0)
+ jasmine-core (~> 2.4)
phantomjs
rack (>= 1.2.1)
rake
- jasmine-core (2.3.4)
+ jasmine-core (2.4.1)
launchy (2.4.3)
addressable (~> 2.3)
- libv8 (3.16.14.11)
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
- mime-types (2.6.2)
- mini_portile (0.6.2)
+ mime-types (2.99)
+ mini_portile2 (2.0.0)
multi_json (1.11.2)
- netrc (0.10.3)
- nokogiri (1.6.6.2)
- mini_portile (~> 0.6.0)
+ netrc (0.11.0)
+ nokogiri (1.6.7.1)
+ mini_portile2 (~> 2.0.0.rc2)
phantomjs (1.9.8.0)
pit (0.0.7)
- power_assert (0.2.4)
- pry (0.10.2)
+ power_assert (0.2.6)
+ pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
- pry-byebug (3.2.0)
- byebug (~> 5.0)
+ pry-byebug (3.3.0)
+ byebug (~> 8.0)
pry (~> 0.10)
rack (1.6.4)
rack-test (0.6.3)
@@ -72,49 +66,46 @@ GEM
rack-test (>= 0.5)
rake (10.4.2)
redcarpet (3.3.3)
- ref (2.0.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
- rspec (3.3.0)
- rspec-core (~> 3.3.0)
- rspec-expectations (~> 3.3.0)
- rspec-mocks (~> 3.3.0)
- rspec-core (3.3.2)
- rspec-support (~> 3.3.0)
- rspec-expectations (3.3.1)
+ rspec (3.4.0)
+ rspec-core (~> 3.4.0)
+ rspec-expectations (~> 3.4.0)
+ rspec-mocks (~> 3.4.0)
+ rspec-core (3.4.1)
+ rspec-support (~> 3.4.0)
+ rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.3.0)
- rspec-mocks (3.3.2)
+ rspec-support (~> 3.4.0)
+ rspec-mocks (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.3.0)
- rspec-support (3.3.0)
+ rspec-support (~> 3.4.0)
+ rspec-support (3.4.1)
rubyzip (1.1.7)
- selenium-webdriver (2.47.1)
+ selenium-webdriver (2.48.1)
childprocess (~> 0.5)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0)
- sequel (4.26.0)
+ sequel (4.29.0)
simplecov (0.9.2)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.9.0)
simplecov-html (0.9.0)
slop (3.6.0)
- sprockets (3.3.5)
+ sprockets (3.5.2)
+ concurrent-ruby (~> 1.0)
rack (> 1, < 3)
- sqlite3 (1.3.10)
+ sqlite3 (1.3.11)
term-ansicolor (1.3.2)
tins (~> 1.0)
- test-unit (3.1.4)
+ test-unit (3.1.5)
power_assert
- therubyracer (0.12.2)
- libv8 (~> 3.16.14.0)
- ref
thor (0.19.1)
- tins (1.6.0)
+ tins (1.8.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
@@ -127,10 +118,9 @@ PLATFORMS
DEPENDENCIES
capybara
- coffee-script
coveralls (~> 0.7.12)
+ emot
fastimage
- gemoji
hikidoc
jasmine
launchy
@@ -148,7 +138,3 @@ DEPENDENCIES
sprockets
sqlite3
test-unit
- therubyracer
-
-BUNDLED WITH
- 1.10.6
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index db8571b..0000000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,24 +0,0 @@
-module.exports = function (grunt) {
- 'use strict';
- grunt.initConfig({
- dir: {
- src: 'src',
- dest: 'dist'
- },
- pkg: grunt.file.readJSON("package.json"),
- bower: {
- install: {
- options: {
- targetDir: './spec/javascripts/lib',
- layout: 'byComponent',
- install: true,
- verbose: false,
- cleanTargetDir: true,
- cleanBowerDir: false
- }
- }
- },
- });
- grunt.loadNpmTasks('grunt-bower-task');
- grunt.registerTask('default', ['bower:install']);
-};
diff --git a/bower.json b/bower.json
deleted file mode 100644
index 2b3a315..0000000
--- a/bower.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "tdiary-core",
- "version": "4.0.3",
- "homepage": "https://github.com/tdiary/tdiary-core",
- "authors": [
- "SHIBATA Hiroshi <hsbt at ruby-lang.org>"
- ],
- "license": "GPL",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "spec/javascripts/lib"
- ],
- "devDependencies": {
- "jquery": "~2.1.0",
- "jasmine-jquery": "~2.0.3"
- }
-}
diff --git a/config.ru b/config.ru
index a1d92bf..c86f918 100644
--- a/config.ru
+++ b/config.ru
@@ -2,5 +2,4 @@ $:.unshift( File.join(File::expand_path(File::dirname( __FILE__ )), 'lib' ).unta
require 'tdiary/application'
use ::Rack::Reloader unless ENV['RACK_ENV'] == 'production'
-base_dir = '/'
-run TDiary::Application.new( base_dir )
+run TDiary::Application.new
diff --git a/js/02edit.coffee b/js/02edit.coffee
deleted file mode 100644
index 4e1b7bd..0000000
--- a/js/02edit.coffee
+++ /dev/null
@@ -1,5 +0,0 @@
-$(document).ready ->
- form = $('textarea')
- targetArea = $('div.update > div.form').first()
- form.width(targetArea.width()/2.5) if form.width() < targetArea.width()/2.5
- form.height(targetArea.height()/1.5) if form.height() < targetArea.height()/1.5
diff --git a/lib/tdiary/application.rb b/lib/tdiary/application.rb
index 4f82638..dea40a8 100644
--- a/lib/tdiary/application.rb
+++ b/lib/tdiary/application.rb
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
require 'tdiary'
require 'rack/builder'
-require 'tdiary/application/configuration'
require 'tdiary/rack'
# FIXME too dirty hack :-<
@@ -16,44 +15,44 @@ end
module TDiary
class Application
- class << self
- def configure(&block)
- instance_eval &block
- end
+ def initialize( base_dir = nil )
+ index_path = self.index_path
+ update_path = self.update_path
+ assets_path = self.assets_path
+ assets_paths = self.assets_paths
- def config
- @config ||= Configuration.new
- end
- end
+ base_dir ||= self.base_dir
- def initialize( base_dir = '/' )
@app = ::Rack::Builder.app do
map base_dir do
- map Application.config.path[:index] do
+ map '/' do
use TDiary::Rack::HtmlAnchor
use TDiary::Rack::Static, "public"
use TDiary::Rack::ValidRequestPath
- run TDiary::Dispatcher.index
+ map index_path do
+ run TDiary::Dispatcher.index
+ end
end
- map Application.config.path[:update] do
+ map update_path do
use TDiary::Rack::Auth
run TDiary::Dispatcher.update
end
- map Application.config.path[:assets] do
+ map assets_path do
environment = Sprockets::Environment.new
- TDiary::Application.config.assets_paths.each {|assets_path|
+ assets_paths.each {|assets_path|
environment.append_path assets_path
}
- if Application.config.assets_precompile
+ if TDiary.configuration.options['tdiary.assets.precompile']
+ TDiary.logger.info('enable assets.precompile')
require 'tdiary/rack/assets/precompile'
use TDiary::Rack::Assets::Precompile, environment
end
run environment
- end
+ end
end
end
run_plugin_startup_procs
@@ -69,6 +68,34 @@ module TDiary
end
end
+ protected
+ def assets_paths
+ TDiary::Extensions::constants.map {|extension|
+ TDiary::Extensions::const_get( extension ).assets_path
+ }.flatten.uniq
+ end
+
+ def index_path
+ (Pathname.new('/') + TDiary.configuration.index).to_s
+ end
+
+ def update_path
+ (Pathname.new('/') + TDiary.configuration.update).to_s
+ end
+
+ def assets_path
+ '/assets'
+ end
+
+ def base_dir
+ base_url = TDiary.configuration.base_url
+ if base_url.empty?
+ '/'
+ else
+ URI.parse(base_url).path
+ end
+ end
+
private
def run_plugin_startup_procs
# avoid offline mode at CGI.new
diff --git a/lib/tdiary/application/configuration.rb b/lib/tdiary/application/configuration.rb
deleted file mode 100644
index abd8e6a..0000000
--- a/lib/tdiary/application/configuration.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-module TDiary
- class Application
- class Configuration
- attr_accessor :assets_precompile, :plugin_paths, :path
-
- def initialize
- # if you need to auto compilation for CoffeeScript
- @assets_precompile = false;
- @plugin_paths = []
- @path = {
- index: '/',
- update: '/update.rb',
- assets: '/assets'
- }
- end
-
- def assets_paths
- TDiary::Extensions::constants.map {|extension|
- TDiary::Extensions::const_get( extension ).assets_path
- }.flatten.uniq
- end
- end
- end
-end
-
-# Local Variables:
-# mode: ruby
-# indent-tabs-mode: t
-# tab-width: 3
-# ruby-indent-level: 3
-# End:
diff --git a/lib/tdiary/configuration.rb b/lib/tdiary/configuration.rb
index de26003..c361ffb 100644
--- a/lib/tdiary/configuration.rb
+++ b/lib/tdiary/configuration.rb
@@ -60,8 +60,10 @@ module TDiary
def base_url
if @options['base_url'] && @options['base_url'].length > 0
@options['base_url']
- else
+ elsif @request
@request.base_url
+ else
+ ''
end
end
diff --git a/lib/tdiary/core_ext.rb b/lib/tdiary/core_ext.rb
index efb0f7c..b1b2087 100644
--- a/lib/tdiary/core_ext.rb
+++ b/lib/tdiary/core_ext.rb
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-require 'gemoji'
+require 'emot'
module TDiary
module RequestExtension
@@ -44,8 +44,8 @@ class String
emoji_url = %Q[<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/%s.png' width='20' height='20' title='%s' alt='%s' class='emoji' />]
if emoji_alias == 'plus1' or emoji_alias == '+1'
emoji_url % (['plus1']*3)
- elsif emoji = Emoji.find_by_alias(emoji_alias)
- emoji_url % ([CGI.escape(emoji.name)]*3)
+ elsif Emot.unicode(emoji_alias)
+ emoji_url % ([CGI.escape(emoji_alias)]*3)
else
match
end
diff --git a/lib/tdiary/rack/assets/precompile.rb b/lib/tdiary/rack/assets/precompile.rb
deleted file mode 100644
index 174d82e..0000000
--- a/lib/tdiary/rack/assets/precompile.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-require 'coffee-script'
-require 'fileutils'
-
-module TDiary
- module Rack
- module Assets
- class Precompile
- def initialize(app, environment = nil)
- @app = app
- @environment = environment
- end
-
- def call( env )
- @environment.each_file do |script|
- next unless script.to_s =~ /\.coffee\z/
- js_path = Pathname.new(script.to_s.gsub(/\.coffee\z/, '.js'))
-
- if !FileTest.exist?(js_path) || FileUtils.uptodate?(script, [js_path])
- File.open(js_path, 'w') do |js|
- js.write CoffeeScript.compile(File.read(script))
- end
- end
- end if @environment
- @app.call( env )
- end
- end
- end
- end
-end
-
-# Local Variables:
-# mode: ruby
-# indent-tabs-mode: t
-# tab-width: 3
-# ruby-indent-level: 3
-# End:
diff --git a/lib/tdiary/rack/auth/omniauth.rb b/lib/tdiary/rack/auth/omniauth.rb
index a139753..ab7da7d 100644
--- a/lib/tdiary/rack/auth/omniauth.rb
+++ b/lib/tdiary/rack/auth/omniauth.rb
@@ -19,14 +19,15 @@ class TDiary::Rack::Auth::OmniAuth
raise NoStrategyFoundError.new("Not found any strategies. Write the omniauth strategy in your Gemfile.local.")
end
- @builder = ::Rack::Builder.new(app) {
+ @app = ::Rack::Builder.new(app) {
use TDiary::Rack::Session
- }
- @builder.instance_eval(&self.class.provider_procs[provider])
+ }.tap {|builder|
+ builder.instance_eval(&self.class.provider_procs[provider])
+ }.to_app
end
def call(env)
- @builder.call(env)
+ @app.call(env)
end
add_provider(:Twitter) do
diff --git a/lib/tdiary/tasks/assets.rake b/lib/tdiary/tasks/assets.rake
index 005487d..4a15981 100644
--- a/lib/tdiary/tasks/assets.rake
+++ b/lib/tdiary/tasks/assets.rake
@@ -1,15 +1,4 @@
namespace :assets do
- if defined? CoffeeScript
- desc "compile coffeescript"
- task :compile do
- FileList['js/**/*.coffee'].each do |coffee|
- File.open(coffee.sub(/\.coffee\z/, '.js'), 'w') do |js|
- js.write CoffeeScript.compile(File.read(coffee))
- end
- end
- end
- end
-
desc "copy assets files"
task :copy do
require 'fileutils'
diff --git a/lib/tdiary/tasks/release.rake b/lib/tdiary/tasks/release.rake
index dd187a9..24cb230 100644
--- a/lib/tdiary/tasks/release.rake
+++ b/lib/tdiary/tasks/release.rake
@@ -34,7 +34,7 @@ def make_tarball( repo, version = nil )
sh "chmod +x index.rb index.fcgi update.rb update.fcgi"
sh 'rake doc'
Bundler.with_clean_env do
- sh "bundle --path .bundle --without coffee:development:test"
+ sh "bundle --path .bundle --without development:test"
end
# reduce filesize
@@ -48,23 +48,12 @@ def make_tarball( repo, version = nil )
end
Dir.chdir '.bundle/ruby' do
- v = `ls`.chomp
- case v
- when '2.2.0'
- FileUtils.cp_r '2.2.0', '2.0.0'
- FileUtils.cp_r '2.2.0', '2.1.0'
- when '2.1.0'
- FileUtils.cp_r '2.1.0', '2.0.0'
- FileUtils.cp_r '2.1.0', '2.2.0'
- when '2.0.0'
- FileUtils.cp_r '2.0.0', '2.1.0'
- FileUtils.cp_r '2.0.0', '2.2.0'
- else
- FileUtils.cp_r v, '2.2.0'
- FileUtils.cp_r v, '2.1.0'
- FileUtils.cp_r v, '2.0.0'
- FileUtils.rm_rf v
- end
+ versions = %w(2.0.0, 2.1.0, 2.2.0, 2.3.0)
+ current = `ls`.chomp
+ versions.each {|version|
+ FileUtils.cp_r current, version unless current == version
+ }
+ FileUtils.rm_rf current unless versions.member?(current)
end
Dir.chdir 'misc/lib' do
sh 'gem unpack bundler'
diff --git a/lib/tdiary/version.rb b/lib/tdiary/version.rb
index a2b9990..241ecca 100644
--- a/lib/tdiary/version.rb
+++ b/lib/tdiary/version.rb
@@ -1,3 +1,3 @@
module TDiary
- VERSION = '4.2.0'
+ VERSION = '4.2.1'
end
diff --git a/misc/plugin/category.rb b/misc/plugin/category.rb
index 6994cbe..b25b063 100644
--- a/misc/plugin/category.rb
+++ b/misc/plugin/category.rb
@@ -169,7 +169,7 @@ def category_dropdown_list(label = nil, multiple = nil)
end
options = ''
- (['ALL'] + @categories.sort_by{|e| e.downcase}).each do |c|
+ (['ALL'] + @categories).each do |c|
options << %Q|\t\t<option value="#{h c}"#{" selected" if category.include?(c)}>#{h c}</option>\n|
end
@@ -580,7 +580,7 @@ def category_edit_support_flatlist
ret = ''
ret << '<div class="field title">'
ret << "#{@category_conf_label}:\n"
- @categories.sort_by{|e| e.downcase}.each do |c|
+ @categories.each do |c|
ret << %Q!| <span class="category-item">#{h c}</span>\n!
end
ret << "|\n</div>\n<br>\n"
@@ -591,7 +591,7 @@ def category_edit_support_dropdown
ret = ''
ret << '<div class="field title">'
ret << %Q|#{@category_conf_label}: <select id="category-candidate" name="category-candidate">\n|
- @categories.sort_by{|e| e.downcase}.each do |c|
+ @categories.each do |c|
ret << %Q!<option>#{h c}</option>\n!
end
ret << "|\n</select>\n</div>\n<br>\n"
@@ -727,7 +727,7 @@ if @mode == 'conf' || @mode == 'saveconf'
end
end
- at categories = @category_cache.restore_categories
+ at categories = @category_cache.restore_categories.sort_by{|e| e.downcase}
if @mode == 'categoryview'
info = Category::Info.new(@cgi, @years, @conf)
@categorized = @category_cache.categorize(info.category, info.years)
diff --git a/package.json b/package.json
index 854d106..d66d27b 100644
--- a/package.json
+++ b/package.json
@@ -21,9 +21,7 @@
},
"homepage": "https://github.com/tdiary/tdiary-core",
"devDependencies": {
- "bower": "*",
- "grunt": "*",
- "grunt-cli": "*",
- "grunt-bower-task": "*"
- }
+ "jquery": "~2.1.0",
+ "jasmine-jquery": "~2.0.3"
+ }
}
diff --git a/spec/core/application_spec.rb b/spec/core/application_spec.rb
index 3206cfe..f12322a 100644
--- a/spec/core/application_spec.rb
+++ b/spec/core/application_spec.rb
@@ -26,7 +26,15 @@ describe TDiary::Application do
end
context "with base_dir" do
- let(:app) { TDiary::Application.new('/diary') }
+ before do
+ TDiary.configuration.options['base_url'] = 'http://example.com/diary/'
+ end
+
+ after do
+ TDiary.configuration.options['base_url'] = ''
+ end
+
+ let(:app) { TDiary::Application.new }
it do
get '/diary/'
diff --git a/spec/core/core_ext_spec.rb b/spec/core/core_ext_spec.rb
index 8692aa2..860c489 100644
--- a/spec/core/core_ext_spec.rb
+++ b/spec/core/core_ext_spec.rb
@@ -50,7 +50,7 @@ describe "core extension library" do
context "thumbsupでもemojify" do
before { @result = "いいね!:thumbsup:".emojify }
it do
- expect(@result).to eq "いいね!<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/%2B1.png' width='20' height='20' title='%2B1' alt='%2B1' class='emoji' />"
+ expect(@result).to eq "いいね!<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/thumbsup.png' width='20' height='20' title='thumbsup' alt='thumbsup' class='emoji' />"
end
end
diff --git a/spec/core/rack/assets/precompile_spec.rb b/spec/core/rack/assets/precompile_spec.rb
deleted file mode 100644
index dcc420b..0000000
--- a/spec/core/rack/assets/precompile_spec.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-require 'spec_helper'
-require 'rack/test'
-require 'fileutils'
-require 'sprockets'
-require 'tdiary/rack/assets/precompile'
-
-describe TDiary::Rack::Assets::Precompile do
- include Rack::Test::Methods
-
- let(:app) do
- TDiary::Rack::Assets::Precompile.new(lambda{|env| [200, {}, ['Awesome']]}, @environment)
- end
- let(:assets_path) {"#{TDiary::PATH}/tmp/assets"}
-
- before do
- FileUtils.mkdir_p assets_path
- @environment = Sprockets::Environment.new
- @environment.append_path assets_path
- end
-
- after do
- FileUtils.rm_rf assets_path
- end
-
- context "JavaScript が無い場合" do
- before do
- FileUtils.touch "#{assets_path}/foo.coffee"
- get '/'
- end
-
- it "JavaScript にコンパイルされる" do
- expect(FileTest.exist?("#{assets_path}/foo.js")).to be_truthy
- end
- end
-
- context "JavaScript がある場合" do
- context "CoffeeScript の方が新しい場合" do
- before do
- FileUtils.touch "#{assets_path}/foo.js"
- sleep 1
- FileUtils.touch "#{assets_path}/foo.coffee"
- @jstime = File.mtime("#{assets_path}/foo.js").to_i
-
- get '/'
- end
-
- it "JavaScript が更新される" do
- expect(@jstime).to be < File.mtime("#{assets_path}/foo.js").to_i
- end
- end
-
- context "JavaScript の方が新しい場合" do
- before do
- FileUtils.touch "#{assets_path}/foo.coffee"
- sleep 1
- FileUtils.touch "#{assets_path}/foo.js"
- @jstime = File.mtime("#{assets_path}/foo.js").to_i
-
- get '/'
- end
-
- it "JavaScript は更新されない" do
- expect(@jstime).to eq(File.mtime("#{assets_path}/foo.js").to_i)
- end
- end
- end
-end
-
-# Local Variables:
-# mode: ruby
-# indent-tabs-mode: t
-# tab-width: 3
-# ruby-indent-level: 3
-# End:
diff --git a/spec/javascripts/support/jasmine.yml b/spec/javascripts/support/jasmine.yml
index 0be5453..364d3ee 100644
--- a/spec/javascripts/support/jasmine.yml
+++ b/spec/javascripts/support/jasmine.yml
@@ -1,6 +1,6 @@
src_files:
- - "spec/javascripts/lib/jquery/jquery.js"
- - "spec/javascripts/lib/**/*.js"
+ - "node_modules/jquery/dist/jquery.js"
+ - "node_modules/jasmine-jquery/lib/jasmine-jquery.js"
- "js/**/*.js"
stylesheets:
diff --git a/tdiary.gemspec b/tdiary.gemspec
index 8d63225..abd9033 100644
--- a/tdiary.gemspec
+++ b/tdiary.gemspec
@@ -13,12 +13,28 @@ Gem::Specification.new do |spec|
spec.homepage = "http://www.tdiary.org/"
spec.license = "GPL2"
- spec.files = `git ls-files`.split($/)
+ spec.files = Dir[
+ 'ChangeLog',
+ 'config.ru',
+ 'Gemfile',
+ 'Gemfile.lock',
+ 'README.md',
+ 'Rakefile',
+ 'tdiary.conf*',
+ 'bin/**/*',
+ 'doc/**/*',
+ 'js/**/*',
+ 'lib/**/*',
+ 'misc/**/*',
+ 'public/**/*',
+ 'theme/**/*',
+ 'vendor/**/*',
+ 'views/**/*'
+ ]
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.required_ruby_version = '>= 1.9.2'
+ spec.required_ruby_version = '>= 2.0.0'
spec.add_dependency 'thor', '~> 0.18'
spec.add_dependency "bundler", "~> 1.3"
diff --git a/theme/default/default.css b/theme/default/default.css
index da35fa7..be7312b 100644
--- a/theme/default/default.css
+++ b/theme/default/default.css
@@ -673,11 +673,14 @@ div.sidebar div.calendar {
*/
@media screen and (max-device-width: 480px) {
body {
+ box-sizing: border-box;
}
div.adminmenu {
font-size: x-small;
margin: 0px;
+ padding-left: 0px;
+ padding-right: 0px;
width: 100%;
}
@@ -687,7 +690,7 @@ div.sidebar div.calendar {
}
div.whole-content {
- width: 100%;
+ width: 95%;
}
div.main {
@@ -739,5 +742,9 @@ div.sidebar div.calendar {
textarea {
font-size: 110%;
}
+
+ div.sidebar {
+ display: none;
+ }
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/tdiary.git
More information about the Pkg-ruby-extras-commits
mailing list