1+ require 'json'
2+
3+ module ValidatableKit
4+ module Spec
5+ def common_spec
6+ package = JSON . parse ( File . read ( 'package.json' ) , { object_class : OpenStruct } )
7+
8+ self . version = package . version . to_s
9+ self . homepage = package . homepage
10+ self . summary = package . summary
11+ self . description = package . description
12+ self . license = { :type => package . license , :file => 'LICENSE' }
13+ self . social_media_url = package . author . url
14+ self . readme = "#{ self . homepage } /blob/main/README.md"
15+ self . changelog = "#{ self . homepage } /blob/main/CHANGELOG.md"
16+
17+ self . source = {
18+ package . repository . type . to_sym => package . repository . url ,
19+ :tag => "v#{ self . version } "
20+ }
21+
22+ self . authors = {
23+ package . author . name => package . author . email
24+ }
25+
26+ self . swift_version = '5.0'
27+ self . ios . deployment_target = '8.0'
28+ self . macos . deployment_target = '10.10'
29+ self . tvos . deployment_target = '9.0'
30+ self . watchos . deployment_target = '2.0'
31+ self . osx . deployment_target = '10.10'
32+ end
33+
34+ def file_spec
35+ self . documentation_url = "https://swiftylab.github.io/ValidatableKit/#{ self . version } /documentation/#{ self . module_name . downcase } /"
36+ self . source_files = "Sources/#{ self . module_name } /**/*.swift" , "Sources/#{ self . module_name } /*.docc"
37+ self . preserve_paths = "Sources/#{ self . module_name } /**/*" , "*.md"
38+ # @todo: Enable when CocoaPods starts supporting docc
39+ # s.source_files = "#{s.module_name}.docc"
40+ end
41+ end
42+ end
0 commit comments