Skip to content

Commit

Permalink
Merge branch 'release/0.9.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Dec 5, 2021
2 parents 641faad + fd808be commit a0c57cb
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 28 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: build
on: [push, pull_request]
on:
push:
branches-ignore:
pull_request:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build_archive
on:
push:
branches-ignore:
- '**'
tags:
- '**'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
archive:
runs-on: ubuntu-latest
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
echo ::set-output name=plugin::$REPOSITORY
- uses: actions/checkout@v2
- name: Archive
run: |
cd ..; zip -r ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ -x "*.git*"; mv ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: ${{ steps.version.outputs.version }}
body: ''
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.version.outputs.filename }}.zip
asset_name: ${{ steps.version.outputs.filename }}.zip
asset_content_type: application/zip
4 changes: 3 additions & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
end
require 'redmine/wiki_formatting/textile/redcloth3'

$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib"

Rails.configuration.to_prepare do
ProjectsHelperMethodsWikiExtensions.apply
WikiExtensionsProjectsHelperPatch.apply
end

require_dependency 'wiki_extensions_notifiable_patch'
Expand Down
4 changes: 2 additions & 2 deletions lib/wiki_extensions_div_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

module WikiExtensionsWikiMacro
module WikiExtensionsDivMacro
Redmine::WikiFormatting::Macros.register do
desc "Displays a <pre><div id=" + '"id_name"' + " class=" + '"' + 'class_name' + '"></pre>' + "\n\n" +
" !{{div_start_tag(id_name)}}" + "'\n" +
Expand All @@ -29,7 +29,7 @@ module WikiExtensionsWikiMacro
end
end

module WikiExtensionsWikiMacro
module WikiExtensionsDivMacro
Redmine::WikiFormatting::Macros.register do
desc "Displays a <pre></div></pre>\n\n" +
" !{{div_end_tag}}"
Expand Down
2 changes: 1 addition & 1 deletion lib/emoticons.rb → lib/wiki_extensions_emoticons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# and open the template in the editor.
require "yaml"

module WikiExtensions
module WikiExtensionsEmoticons
YAML_FILE = File.join(File.dirname(__FILE__), '../config/emoticons.yml')
class Emoticons
def emoticons
Expand Down
6 changes: 3 additions & 3 deletions lib/wiki_extensions_formatter_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

require_dependency "redmine/wiki_formatting/textile/formatter"

module FormatterMethodsWikiExtensions
module WikiExtensionsFormatterPatch

Redmine::WikiFormatting::Textile::Formatter::RULES << :inline_smiles

Expand All @@ -28,12 +28,12 @@ def inline_smiles(text)
baseurl = Redmine::Utils.relative_url_root
src = baseurl + "/plugin_assets/redmine_wiki_extensions/images/"

@emoticons = WikiExtensions::Emoticons.new
@emoticons = WikiExtensionsEmoticons::Emoticons.new
@emoticons.emoticons.each{|emoticon|
text.gsub!(Regexp.new("#{Regexp.escape(emoticon['emoticon'])}(\\s|<br/>|</p>)"),
"<img src=\""+src+"#{emoticon['image']}\" alt=\"#{emoticon['emoticon']}\">\\1")
}
end
end

Redmine::WikiFormatting::Textile::Formatter.prepend(FormatterMethodsWikiExtensions)
Redmine::WikiFormatting::Textile::Formatter.prepend(WikiExtensionsFormatterPatch)
4 changes: 2 additions & 2 deletions lib/wiki_extensions_helper_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

require_dependency "redmine/wiki_formatting/textile/helper"

module HelperMethodsWikiExtensions
module WikiExtensionsHelperPatch
def heads_for_wiki_formatter
super
return if ie6_or_ie7?
Expand Down Expand Up @@ -52,4 +52,4 @@ def ie6_or_ie7?
end
end

Redmine::WikiFormatting::Textile::Helper.prepend(HelperMethodsWikiExtensions)
Redmine::WikiFormatting::Textile::Helper.prepend(WikiExtensionsHelperPatch)
2 changes: 1 addition & 1 deletion lib/wiki_extensions_iframe_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

module WikiExtensionsWikiMacro
module WikiExtensionsIframeMacro
Redmine::WikiFormatting::Macros.register do
desc "Insert an iframe tag" + "\n\n" +
" !{{iframe(url, width, height)}}" + "\n\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/wiki_extensions_lastupdated_at_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

module WikiExtensionsWikiMacro
module WikiExtensionsLastupdatedAtMacro
Redmine::WikiFormatting::Macros.register do
desc "Displays a date that updated the page.\n\n" +
" !{{lastupdated_at}}\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/wiki_extensions_lastupdated_by_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

module WikiExtensionsWikiMacro
module WikiExtensionsLastupdatedByMacro
Redmine::WikiFormatting::Macros.register do
desc "Displays a user who updated the page.\n\n" +
" !{{lastupdated_by}}"
Expand Down
2 changes: 1 addition & 1 deletion lib/wiki_extensions_new_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'redmine'

module WikiExtensionsWikiMacro
module WikiExtensionsNewMacro
Redmine::WikiFormatting::Macros.register do
desc "Displays a string 'new'.\n\n" +
" !{{new(yyyy-mm-dd)}}\n" +
Expand Down
4 changes: 2 additions & 2 deletions lib/wiki_extensions_notifiable_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

module NotifiableMethods
module WikiExtensionsNotifiablePatch
def self.prepended(base)
class << base
self.prepend(ClassMethods)
Expand All @@ -31,4 +31,4 @@ def all
end
end

Redmine::Notifiable.prepend(NotifiableMethods)
Redmine::Notifiable.prepend(WikiExtensionsNotifiablePatch)
4 changes: 2 additions & 2 deletions lib/wiki_extensions_projects_helper_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

require_dependency 'projects_helper'

module ProjectsHelperMethodsWikiExtensions
module WikiExtensionsProjectsHelperPatch
def self.apply
ProjectsController.send :helper, ProjectsHelperMethodsWikiExtensions
ProjectsController.send :helper, WikiExtensionsProjectsHelperPatch
end
def project_settings_tabs
tabs = super
Expand Down
2 changes: 1 addition & 1 deletion lib/wiki_extensions_taggedpages_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'redmine'

module WikiExtensionsWikiMacro
module WikiExtensionsTaggedpagesMacro
Redmine::WikiFormatting::Macros.register do
desc "Displays pages that have specified tag.\n\n"+
" !{{taggedpages(tagname)}}\n" +
Expand Down
2 changes: 1 addition & 1 deletion lib/wiki_extensions_tags_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'redmine'

module WikiExtensionsWikiMacro
module WikiExtensionsTagsMacro
Redmine::WikiFormatting::Macros.register do
desc "Displays tags.\n\n"+
" !{{tags}}\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/wiki_extensions_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def WikiExtensionsUtil.is_enabled?(project)

def WikiExtensionsUtil.tag_enabled?(project)
return false unless project
setting = WikiExtensionsSetting.find_or_create(project)
setting = WikiExtensionsSetting.find_or_create(project.id)
!setting.tag_disabled
end
end
2 changes: 1 addition & 1 deletion lib/wiki_extensions_vote_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'redmine'

module WikiExtensionsWikiMacro
module WikiExtensionsVoteMacro
Redmine::WikiFormatting::Macros.register do
desc "Vote macro.\n\n"+
" !{{vote(key)}}\n" +
Expand Down
4 changes: 2 additions & 2 deletions lib/wiki_extensions_wiki_controller_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WikiController
after_action :wiki_extensions_save_tags, :only => [:edit, :update]
end

module InstanceMethodsForWikiExtensionWikiController
module WikiExtensionsWikiControllerPatch
def render(args = nil)
if args and @project and WikiExtensionsUtil.is_enabled?(@project) and @content
if (args.class == Hash and args[:partial] == 'common/preview')
Expand Down Expand Up @@ -93,6 +93,6 @@ def wiki_extensions_include_footer
end
end

WikiController.prepend(InstanceMethodsForWikiExtensionWikiController)
WikiController.prepend(WikiExtensionsWikiControllerPatch)


4 changes: 2 additions & 2 deletions lib/wiki_extensions_wiki_page_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WikiPage
has_one :wiki_extensions_count, :foreign_key => :page_id, :dependent => :destroy
end

module WikiExtensionsWikiPageMethods
module WikiExtensionsWikiPagePatch
def wiki_extension_data
@wiki_extension_data ||= {}
end
Expand Down Expand Up @@ -52,5 +52,5 @@ def set_tags(tag_list = {})

end

WikiPage.prepend(WikiExtensionsWikiPageMethods)
WikiPage.prepend(WikiExtensionsWikiPagePatch)

4 changes: 2 additions & 2 deletions test/unit/emoticons_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

require File.dirname(__FILE__) + '/../test_helper'
require "emoticons"
require "wiki_extensions_emoticons"

class EmoticonsTest < ActiveSupport::TestCase
fixtures :wiki_extensions_comments

context "emoticons" do
setup do
@emoticons = WikiExtensions::Emoticons.new
@emoticons = WikiExtensionsEmoticons::Emoticons.new
end

should "not returns nil." do
Expand Down

0 comments on commit a0c57cb

Please sign in to comment.