You need to sign in or sign up before continuing.

active_scaffold_camera 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: 6d2dd4e1f852c81a0a90e6b77b0db2fdf259a974843c907e059283bcc0b251be
4
- data.tar.gz: 01eeb04a95ba9e38326e0038e203019b521342f8b5a1b3803d12f00995e511d6
3
+ metadata.gz: 8497b20150f3eb5d4fcea8deadbc50b702ce52343dd07059d3622a9a356c9401
4
+ data.tar.gz: b45f7073b101da915f5d9b6c121e50402b8b68c6a4d9998c708a15bdea04289a
5
5
  SHA512:
6
- metadata.gz: 320c8a9a6e429e0155a31823db685ef430e4eabe806641ba2f856ed942a06e253cfdd1614a09c2cd0d58b1ba6c413902eb0989123bd8799edf988b31514a6761
7
- data.tar.gz: 9ad5a523b0f1b902f5d33f35a15e5c5a9cfbb2e18ca9313f5a2ae3d04d655f325f65e471acbd41d585ea1b179a61a7ea8c6da2eb6ecb3fd3541a37e2abe17e29
6
+ metadata.gz: ca95676e84b4f6467efa21b5b63f19616065607603ff382f769a3aae3a346211cfbdd195e1128f6f3ccefd48ae47ae948e0c4163bdf58489cf835018005d39e8
7
+ data.tar.gz: 867931f1ff2105a56ef1c5427550161ec2d3963655a14ab1b3baebcd74b4adb9860c3fd6e1511262591b0699432b6c3320d64409fb212dc226e78c257a1addcc
data/README.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Camera for ActiveScaffold
2
2
 
3
+ [![Build status](https://github.com/activescaffold/active_scaffold_camera/actions/workflows/ci.yml/badge.svg)](https://github.com/activescaffold/active_scaffold_camera/actions/workflows/ci.yml)
4
+ [![Maintainability](https://qlty.sh/gh/activescaffold/projects/active_scaffold_camera/maintainability.svg)](https://qlty.sh/gh/activescaffold/projects/active_scaffold_camera)
5
+ [![Code Coverage](https://qlty.sh/gh/activescaffold/projects/active_scaffold_camera/coverage.svg)](https://qlty.sh/gh/activescaffold/projects/active_scaffold_camera)
6
+ [![Gem Version](https://badge.fury.io/rb/active_scaffold_camera.svg)](https://badge.fury.io/rb/active_scaffold_camera)
7
+ [![Inline docs](https://inch-ci.org/github/activescaffold/active_scaffold_camera.svg?branch=master)](https://inch-ci.org/github/activescaffold/active_scaffold_camera)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
9
+
3
10
  Currently, this plugin is compatible with ActiveScaffold >= 3.4 gem.
4
11
 
5
12
  ## Overview
@@ -1,6 +1,3 @@
1
- //= require say-cheese
2
- //= require_self
3
-
4
1
  ActiveScaffold.snapshot = function(selector_or_elements, parent) {
5
2
  function modernMediaApi() {
6
3
  return navigator.mediaDevices && navigator.mediaDevices.getUserMedia;
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveScaffoldCamera
2
4
  class Engine < ::Rails::Engine
3
5
  initializer 'active_scaffold_camera.action_view' do
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveScaffoldCamera
2
4
  module Version
3
5
  MAJOR = 0
4
- MINOR = 2
6
+ MINOR = 3
5
7
  PATCH = 0
6
8
 
7
9
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
@@ -1,22 +1,25 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveScaffoldCamera
2
4
  module ViewHelpers
3
- I18N_ATTRIBUTES = [:video_not_supported, :audio_not_supported, :media_forbidden]
5
+ I18N_ATTRIBUTES = %i[video_not_supported audio_not_supported media_forbidden].freeze
4
6
  def snapshot_attributes(column, ui_options: column.options)
5
- attributes = Hash[I18N_ATTRIBUTES.map{ |attr| [attr, ui_options[attr] || attr] }]
7
+ attributes = I18N_ATTRIBUTES.index_with { |attr| ui_options[attr] || attr }
6
8
  attributes[:source] = ui_options[:source] if ui_options[:source]
7
9
  I18N_ATTRIBUTES.each { |attr| attributes[attr] = as_(attributes[attr]) if attributes[attr].is_a? Symbol }
8
10
  attributes
9
11
  end
10
12
 
11
13
  def active_scaffold_input_snapshot(column, html_options, ui_options: column.options)
12
- content_tag :div, :class => "snapshot-input #{html_options[:class]}", :id => html_options[:id], :data => snapshot_attributes(column, ui_options: ui_options) do
13
- hidden_field :record, column.name, :name => html_options[:name]
14
+ content_tag :div, class: "snapshot-input #{html_options[:class]}", id: html_options[:id],
15
+ data: snapshot_attributes(column, ui_options: ui_options) do
16
+ hidden_field :record, column.name, name: html_options[:name]
14
17
  end
15
18
  end
16
19
 
17
20
  def active_scaffold_column_snapshot(record, column, ui_options: column.options)
18
21
  value = record.send(column.name)
19
- tag :img, :src => value if value
22
+ tag.img(src: value) if value
20
23
  end
21
24
  end
22
25
  end
@@ -1,11 +1,13 @@
1
- require "active_scaffold_camera/engine.rb"
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_scaffold_camera/engine'
2
4
 
3
5
  module ActiveScaffoldCamera
4
6
  def self.root
5
- File.dirname(__FILE__) + "/.."
7
+ "#{File.dirname(__FILE__)}/.."
6
8
  end
7
- autoload 'ViewHelpers', 'active_scaffold_camera/view_helpers.rb'
9
+ autoload :ViewHelpers, 'active_scaffold_camera/view_helpers.rb'
8
10
  end
9
11
 
10
12
  ActiveScaffold.stylesheets << 'active_scaffold_camera'
11
- ActiveScaffold.javascripts << 'active_scaffold_camera'
13
+ ActiveScaffold.javascripts.push('say-cheese', 'active_scaffold_camera')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_camera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
@@ -10,20 +10,6 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 1980-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: active_scaffold
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +47,8 @@ files:
61
47
  homepage: http://github.com/activescaffold/active_scaffold_camera
62
48
  licenses:
63
49
  - MIT
64
- metadata: {}
50
+ metadata:
51
+ rubygems_mfa_required: 'true'
65
52
  rdoc_options: []
66
53
  require_paths:
67
54
  - lib
@@ -69,7 +56,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
56
  requirements:
70
57
  - - ">="
71
58
  - !ruby/object:Gem::Version
72
- version: '0'
59
+ version: '3.2'
73
60
  required_rubygems_version: !ruby/object:Gem::Requirement
74
61
  requirements:
75
62
  - - ">="