sass-embedded 0.1.0 → 0.1.1

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: 7d0da205f0cb44177b737a82ce4addac1c94afe4da4a43327963d11feda1fe75
4
- data.tar.gz: 9821f8807b4eb6b0c612391628d341d416f96df3d3344eeaa762d88d8bbb9f6d
3
+ metadata.gz: 604bb4648958324aedb4a486c281994eb04bc6a2e685e946c07e62ca83ded8ed
4
+ data.tar.gz: 14730abcf938ee7fe9410a1f0055292c6abf95c95a1a7ab2c6f0d7dc3f2893c8
5
5
  SHA512:
6
- metadata.gz: ef2437a502053cdae299f97e9e96b28402d9cdb07c8c40454f9666ccdbe66fc7aa20c17fe629978021e3c4a86d91512c112e04b85a144604fd7ba79992081663
7
- data.tar.gz: af805efa9a30ca83af3e152cb30b0a72649071e9fd2d2f08ea968a4eedab170c02367c2a5afed84156b4c29e71294e8b9be3bb79371ef8388436fe71adb8ea2e
6
+ metadata.gz: 629f7ec2916c32f7821153b47c4c6ebeba09d3995d89273113e9b2ebdb0d477eca9f4ae027fd5144e4b6bdc52c83d2eedc9ca8edcac3d1ea6b79f5f86d528f04
7
+ data.tar.gz: 2b89c4871759f23a1c3e69d53ca61b1a8e45804435e0d84800beec43aa2bc860c707e3a5d10910e855cbf9d3fece3de658c97739b491b26a1c6aba43dec94fa9
@@ -1,2 +1,3 @@
1
+ /embedded_sass*
1
2
  /sass_embedded*
2
- /embedded_sass_pb.*
3
+ /protoc*
@@ -1,23 +1,35 @@
1
1
  .PHONY: install
2
2
  install:
3
3
  ifeq ($(OS),Windows_NT)
4
- powershell -command "Get-Item *.zip | Expand-Archive -DestinationPath (Get-Location) -Force"
4
+ powershell -command "Get-Item sass_embedded-*.zip | Expand-Archive -DestinationPath (Get-Location) -Force"
5
+ powershell -command "Get-Item protoc-*.zip | Expand-Archive -DestinationPath protoc -Force"
6
+ ./protoc/bin/protoc --ruby_out=. embedded_sass.proto
5
7
  else
6
- tar -vxzf *.tar.gz
8
+ tar -vxzf sass_embedded-*.tar.gz
9
+ unzip -od protoc protoc-*.zip
10
+ ./protoc/bin/protoc --ruby_out=. embedded_sass.proto
7
11
  endif
8
12
 
9
13
  .PHONY: clean
10
14
  clean:
11
15
  ifeq ($(OS),Windows_NT)
12
16
  powershell -command "Remove-Item sass_embedded -Recurse -Force -ErrorAction Ignore"
17
+ powershell -command "Remove-Item protoc -Recurse -Force -ErrorAction Ignore"
18
+ powershell -command "Remove-Item embedded_sass_pb.rb -Recurse -Force -ErrorAction Ignore"
13
19
  else
14
20
  rm -rf sass_embedded
21
+ rm -rf protoc
22
+ rm -rf embedded_sass_pb.rb
15
23
  endif
16
24
 
17
25
  .PHONY: distclean
18
26
  distclean: clean
19
27
  ifeq ($(OS),Windows_NT)
20
28
  powershell -command "Remove-Item sass_embedded-*.zip -Force -ErrorAction Ignore"
29
+ powershell -command "Remove-Item protoc-*.zip -Force -ErrorAction Ignore"
30
+ powershell -command "Remove-Item embedded_sass.proto -Force -ErrorAction Ignore"
21
31
  else
22
32
  rm -rf sass_embedded-*.tar.gz
33
+ rm -rf protoc-*.zip
34
+ rm -rf embedded_sass.proto
23
35
  endif
@@ -46,7 +46,6 @@ def download_sass_embedded
46
46
  raise "Unsupported Arch: #{Sass::Platform::ARCH}"
47
47
  end
48
48
 
49
-
50
49
  ext = case os
51
50
  when "windows"
52
51
  "zip"
@@ -63,8 +62,68 @@ def download_sass_embedded
63
62
  end
64
63
  end
65
64
 
65
+ def download_protoc
66
+ repo = "protocolbuffers/protobuf"
67
+
68
+ tag = URI.open('https://github.com/protocolbuffers/protobuf/releases/latest') { |file|
69
+ File.basename file.base_uri.to_s
70
+ }
71
+
72
+ release = tag[1..-1]
73
+
74
+ os = case Sass::Platform::OS
75
+ when "darwin"
76
+ "osx"
77
+ when "linux"
78
+ "linux"
79
+ when "windows"
80
+ "win"
81
+ else
82
+ raise "Unsupported OS: #{Sass::Platform::OS}"
83
+ end
84
+
85
+ arch = case Sass::Platform::ARCH
86
+ when "aarch64"
87
+ "aarch_64"
88
+ when "sparcv9"
89
+ "s390"
90
+ when "i386"
91
+ "x86_32"
92
+ when "x86_64"
93
+ "x86_64"
94
+ when "powerpc64"
95
+ "ppcle_64"
96
+ else
97
+ raise "Unsupported Arch: #{Sass::Platform::ARCH}"
98
+ end
99
+
100
+ os_arch = case os
101
+ when "win"
102
+ os + arch.split('_').last
103
+ else
104
+ os + '-' + arch
105
+ end
106
+
107
+ ext = "zip"
108
+
109
+ url = "https://github.com/#{repo}/releases/download/#{tag}/protoc-#{release}-#{os_arch}.#{ext}"
110
+
111
+ begin
112
+ download url
113
+ rescue
114
+ raise "Failed to download: #{url}"
115
+ end
116
+ end
117
+
118
+ def download_embedded_sass_proto
119
+ url = "https://raw.githubusercontent.com/sass/embedded-protocol/HEAD/embedded_sass.proto"
120
+ download url
121
+ end
122
+
66
123
  system("make", "-C", __dir__, "distclean")
67
124
  download_sass_embedded
125
+ download_protoc
126
+ download_embedded_sass_proto
68
127
  system("make", "-C", __dir__, "install")
69
128
 
70
129
  File.open(File.absolute_path("sass_embedded.#{RbConfig::CONFIG['DLEXT']}", __dir__), "w") {}
data/lib/sass/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sass
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
@@ -110,7 +110,6 @@ files:
110
110
  - Rakefile
111
111
  - ext/sass_embedded/.gitignore
112
112
  - ext/sass_embedded/Makefile
113
- - ext/sass_embedded/embedded_sass_pb.rb
114
113
  - ext/sass_embedded/extconf.rb
115
114
  - lib/sass.rb
116
115
  - lib/sass/embedded/compiler.rb