redmine-user_wiki_macro 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d785be13e4ddf9dde9e20a2c5bf4bca0475abb8d
4
- data.tar.gz: 30d551125580685eed45b91b90175415877610bf
3
+ metadata.gz: 06c0bfb116094c60201ec497a051aa05735f549b
4
+ data.tar.gz: 10ed45350dfacd107d0c1f2ce17cf7507c39a022
5
5
  SHA512:
6
- metadata.gz: 81a96675e5c8d682baf9955b5d6f04f90abd9e0f545f39a845ead1b7da7c9d4d8705f92456d31f370583160915485cf8f835ebee7aeba77ffb156c7ad6227b23
7
- data.tar.gz: c54045ef95d8cbbb26993e7f659bb8bbeab33b336af2de22477ccf803f288cccec5897498703ac1a6e0a2962970c2a30a8655a6c4046d7c1a9ce90413deb2148
6
+ metadata.gz: eef64ddb7f1fbeb8759a47c03e033e5c6d55884e664322d78cc78cf7eb42fd3e751dfc96de173c04fd82341334077e5dd6b9104bc4c46480440e017383f21104
7
+ data.tar.gz: 9d95927ca1a5a8d1a7557b9692b1a24299fcf54de5393b909c21a20bb4397b64c11fcf9a2f3deb530b02dbcae01fbe13dd8d815634e51860b3d62917b2ecf2eb
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  Gemfile.lock
2
+ pkg
@@ -6,3 +6,7 @@ Style/FileName:
6
6
 
7
7
  Documentation:
8
8
  Enabled: false
9
+
10
+ Lint/HandleExceptions:
11
+ Exclude:
12
+ - rakelib/rubocop.rake
data/README.md CHANGED
@@ -1,6 +1,22 @@
1
+ [github]: https://github.com/neopoly/redmine-user_wiki_macro
2
+ [doc]: http://rubydoc.info/github/neopoly/redmine-user_wiki_macro/master/file/README.md
3
+ [gem]: https://rubygems.org/gems/redmine-user_wiki_macro
4
+ [gem-badge]: https://img.shields.io/gem/v/redmine-user_wiki_macro.svg
5
+ [inchpages]: https://inch-ci.org/github/neopoly/redmine-user_wiki_macro
6
+ [inchpages-badge]: https://inch-ci.org/github/neopoly/redmine-user_wiki_macro.svg?branch=master&style=flat
7
+
1
8
  # redmine-user_wiki_macro
2
9
 
3
- Adds a `{{user(login_name)}}` macro to the Redmine's wiki engine
10
+ [![Gem Version][gem-badge]][gem]
11
+ [![Inline docs][inchpages-badge]][inchpages]
12
+
13
+ [Gem][gem] |
14
+ [Source][github] |
15
+ [Documentation][doc]
16
+
17
+ Adds a `{{user(login_name)}}` macro to the Redmine's wiki engine.
18
+
19
+ ![Screenshot](http://neopoly.github.io/redmine-user_wiki_macro/images/screenshot.png)
4
20
 
5
21
  ## Installation
6
22
 
@@ -20,7 +36,10 @@ Restart the Redmine application
20
36
 
21
37
  ## Usage
22
38
 
23
- No further steps needed
39
+ This macros works best with enabled user avatars. Enable the Gravatar images via
40
+ the administration settings:
41
+
42
+ Administration > Settings > Display -> Use Gravatar user icons
24
43
 
25
44
  ## Testing
26
45
 
@@ -32,7 +51,7 @@ No automatic tests, sir! But this Redmine plugin is used in production.
32
51
 
33
52
  ## Contributing
34
53
 
35
- 1. Fork it ( https://github.com/[my-github-username]/redmine-user_wiki_macro/fork )
54
+ 1. Fork it ( https://github.com/neopoly/redmine-user_wiki_macro/fork )
36
55
  2. Create your feature branch (`git checkout -b my-new-feature`)
37
56
  3. Commit your changes (`git commit -am 'Add some feature'`)
38
57
  4. Push to the branch (`git push origin my-new-feature`)
data/Rakefile CHANGED
@@ -3,6 +3,4 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "rubocop/rake_task"
5
5
 
6
- RuboCop::RakeTask.new
7
-
8
6
  task default: [:rubocop]
@@ -2,7 +2,6 @@ require "user_wiki_macro/version"
2
2
  require "user_wiki_macro/infos"
3
3
  require "user_wiki_macro/engine"
4
4
 
5
- # Redmine plugin to support HTTP basic authentication based
6
- # authentication mechanism
5
+ # Redmine plugin to support a custom wiki macros
7
6
  module UserWikiMacro
8
7
  end
@@ -1,9 +1,10 @@
1
1
  module UserWikiMacro
2
2
  module Infos
3
- NAME = "redmine-user_wiki_macro"
4
- DESCRIPTION = "Adds a {{user(login_name)}} macro to Redmine's wiki engine"
5
- LICENSE = "MIT"
6
- URL = "https://github.com/neopoly/redmine-user_wiki_macro"
3
+ NAME = "redmine-user_wiki_macro".freeze
4
+ DESCRIPTION = "Adds a {{user(login_name)}} macro " \
5
+ "to Redmine's wiki engine".freeze
6
+ LICENSE = "MIT".freeze
7
+ URL = "https://github.com/neopoly/redmine-user_wiki_macro".freeze
7
8
  AUTHORS = {
8
9
  "Jonas Thiel" => "jt@neopoly.de"
9
10
  }.freeze
@@ -16,10 +16,21 @@ module UserWikiMacro
16
16
  user = User.find_by_login(username)
17
17
  return nil unless user
18
18
 
19
- content_tag :span, class: "user-wiki-macro user-wiki-macro-user" do
20
- label = avatar(user, size: UserWikiMacro.determine_size(options))
21
- label += content_tag(:span, user.login)
22
- link_to label, user_path(user)
19
+ image = avatar(user, size: UserWikiMacro.determine_size(options))
20
+
21
+ css = ["user-wiki-macro user-wiki-macro-user"]
22
+ label = []
23
+
24
+ if image.present?
25
+ css << "user-wiki-macro-user-with-avatar"
26
+ label << image
27
+ label << content_tag(:span, user.login)
28
+ else
29
+ label << user.login
30
+ end
31
+
32
+ content_tag :span, class: css do
33
+ link_to label.join.html_safe, user_path(user)
23
34
  end
24
35
  end
25
36
  end
@@ -1,3 +1,3 @@
1
1
  module UserWikiMacro
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2".freeze
3
3
  end
@@ -0,0 +1,18 @@
1
+ begin
2
+ require "rubocop/rake_task"
3
+
4
+ Rake::Task[:default].enhance [:rubocop]
5
+
6
+ RuboCop::RakeTask.new do |task|
7
+ task.options << "--display-cop-names"
8
+ end
9
+
10
+ namespace :rubocop do
11
+ desc "Generate a configuration file acting as a TODO list."
12
+ task :auto_gen_config do
13
+ exec "bundle exec rubocop --auto-gen-config"
14
+ end
15
+ end
16
+
17
+ rescue LoadError
18
+ end
@@ -15,8 +15,8 @@ Gem::Specification.new do |spec|
15
15
  spec.license = UserWikiMacro::Infos::LICENSE
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0")
18
- spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(/^(test|spec|features)\//)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "rails", "~> 4.2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine-user_wiki_macro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Thiel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-18 00:00:00.000000000 Z
11
+ date: 2016-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -87,6 +87,7 @@ files:
87
87
  - lib/user_wiki_macro/macros.rb
88
88
  - lib/user_wiki_macro/redmine_plugin.rb
89
89
  - lib/user_wiki_macro/version.rb
90
+ - rakelib/rubocop.rake
90
91
  - redmine-user_wiki_macro.gemspec
91
92
  homepage: https://github.com/neopoly/redmine-user_wiki_macro
92
93
  licenses:
@@ -113,4 +114,3 @@ signing_key:
113
114
  specification_version: 4
114
115
  summary: Adds a {{user(login_name)}} macro to Redmine's wiki engine
115
116
  test_files: []
116
- has_rdoc: